安卓avd模拟器 - 如何将"Do you want to save the current state for the next quick boot?"保存在config.ini文件中



创建 avd 时,首次启动它,然后尝试关闭模拟器,将提示用户出现一个对话框,内容如下:

Do you want to save the current state for the next quick boot?
Note: Saving the snapshot may take longer because free RAM is low.

我想在启动模拟设备之前将此参数保存在其config.ini文件中。

但是我不清楚它是哪个选项。

我尝试过的事情: 将这些行添加到config.ini

fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes

在 avd 的config.ini目录中创建一个名为quickbootChoice.ini的附加文件,该文件仅读取:

saveOnExit = true

这些都没有帮助,在模拟设备的每次首次关闭时,都会弹出此对话框......

提前致谢

根据 https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-emu/android/skin/qt/tool-window.cpp,如果该方法基于以下内容返回,则不会出现弹出窗口:

if (saveOnExitChoice == SaveSnapshotOnExit::Always &&
(fc::isEnabled(fc::QuickbootFileBacked) ||
(!savesWereSlow && !hasLowRam))) {
return true;
}

.android/advancedFeatures.iniQuickbootFileBacked = on设置为我修复了它。请参阅 https://androidstudio.googleblog.com/2018/08/android-emulator-28.html。

如果要从命令行启动模拟器。然后提供-no-snapshot-save参数,以防止其保存。

emulator @Nexus_5X_API_23 -no-snapshot-save

参考: https://developer.android.com/studio/run/emulator-commandline

您可以在 Android Studio 中配置此设置,有关说明,请参阅此答案: 安卓模拟器 - 默认情况下不保存状态

相关内容

最新更新