When I launch the Android emulator from the Android SDK and AVD Manager I can check the boxes Launch from snapshot and Save to snapshot so that the emulator's state is saved when I close it and restored again when I launch it. This is great because I don't have to wait for Android to boot each time the emulator is launched. However, I also want to take snapshots of the emulator's state during a session and later during the session revert back to the snapshot, for example to re-run my tests. How do I do this? There do not seem to be any controls for this in the AVD Manager.
Press for 3 dots. Then Press the Settings and in top right corner you will see the screenshot folder location.
Saving an emulator's state to a snapshot file enables the emulator to be started quickly the next time you try to launch it, effectively bypassing the lengthy boot-up time. This is especially useful for the Android 3.0 emulator, which can take up to five minutes to boot up.
Camera support. The emulator supports the use of basic camera functionality on your virtual device for earlier Android versions. Android 11 and higher supports the following additional Android Emulator camera capabilities: RAW capture.
I found the answer thanks to this comment. To take and load snapshots, start a Telnet session to the emulator:
$ telnet localhost 5554
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: type 'help' for a list of commands
OK
avd snapshot save snapshot_name
OK
avd snapshot load snapshot_name
OK
The Android emulator freezes for a few seconds while saving/loading a snapshot. You can also list the snapshots using avd snapshot list
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With