开发者

How do I take a snapshot of the Android emulator's state?

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 e开发者_运维技巧ach 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜