Android Emulator snapshot flag is not working as expected. I created a new avd with name Mydevice using
tools/bin/avdmanager create avd --force --name Mydevice --abi google_apis/x86 --package 'system-images;android-29;google_apis;x86' --device "Nexus 6P" &
Now I run this avd using
sudo emulator/emulator -avd Mydevice -no-window -port 5554
After emulator is booted successfully, I take a snapshot using
adb -s emulator-5554 emu avd snapshot save Snap1
which successfully creates the snapshot.
Now I stop my running emulator using
adb -s emulator-5554 emu kill
Now I again run the emulator using -read-only flag and using the saved snapshot using
sudo emulator/emulator -avd Mydevice -read-only -no-window -port 5554 -snapshot ~/.android/avd/Mydevice.avd/snapshots/Snap1
but it seems like -snapshot is getting ignored as emulator is still taking same time as earlier to boot.
I also tried removing the read only flag but that did not helped.