'Android avd emulator - how to save "Do you want to save the current state for the next quick boot?" in config.ini file
When creating an avd, starting it for the first time and then trying to close the emulator, the user will be prompted with a dialog reading:
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.
I would like to save this parameter, before starting the emulated device, within its config.ini
file.
However I'm not clear on which option it is.
Things I tried:
Adding these lines to the config.ini
fastboot.chosenSnapshotFile=
fastboot.forceChosenSnapshotBoot=no
fastboot.forceColdBoot=no
fastboot.forceFastBoot=yes
Creating an additional file within the config.ini
directory of the avd called quickbootChoice.ini
that simply reads:
saveOnExit = true
Non of which helped, on every first shutdown of the emulated device this dialog pops up...
Thanks in advance
Solution 1:[1]
You can configure this setting in Android Studio, see this answer for instructions: Android emulator - Don't save state by default
Solution 2:[2]
According to https://android.googlesource.com/platform/external/qemu/+/refs/heads/emu-master-dev/android/android-emu/android/skin/qt/tool-window.cpp the popup does not appear if the method returns based on this:
if (saveOnExitChoice == SaveSnapshotOnExit::Always &&
(fc::isEnabled(fc::QuickbootFileBacked) ||
(!savesWereSlow && !hasLowRam))) {
return true;
}
Setting QuickbootFileBacked = on
in .android/advancedFeatures.ini
fixed it for me. See https://androidstudio.googleblog.com/2018/08/android-emulator-28.html.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Bill Mei |
Solution 2 | C-Otto |