如何拍摄 Android 模拟器状态的快照?

发布于 2024-11-11 01:06:04 字数 266 浏览 6 评论 0原文

当我从 Android SDK 和 AVD Manager 启动 Android 模拟器时,我可以选中从快照启动保存到快照复选框,以便模拟器的当我关闭它时,状态会被保存,当我启动它时,状态会再次恢复。这很棒,因为我不必在每次启动模拟器时都等待 Android 启动。但是,我还想在会话期间拍摄模拟器状态的快照,然后在会话期间恢复到快照,例如重新运行我的测试。我该怎么做? AVD 管理器中似乎没有对此进行任何控制。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

踏雪无痕 2024-11-18 01:06:04

感谢此评论,我找到了答案。要拍摄和加载快照,请启动与模拟器的 Telnet 会话:

$ 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

保存/加载快照时,Android 模拟器会冻结几秒钟。您还可以使用 avd snapshot list 列出快照。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文