Using an emulator snapshot?
See original GitHub issueI’d like to use an emulator snapshot I created on my local machine, but I’m having a bit of trouble sorting out how I can use it from the runner. Locally the snapshot resides in ~/.android/avd/Nexus_6_API_29.avd/snapshots
. So I copied that into the repo via git-lfs
. Then in my job I copy the snapshot from the repo into same path - ~/.android/avd/Nexus_6_API_29.avd/snapshots
. However when I set the emulator-options
to emulator-options: -snapshot SNAPSHOT_NAME -gpu swiftshader_indirect
, it doesn’t appear to pick it up and there’s no errors or anything about the snapshot not existing.
One obvious issue might be the fact that the avd name in the runner is test
not Nexus_6_API_29
, but I’m really not sure. So clarification about how this could be done would be welcome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (6 by maintainers)
@chrisbanes I got snapshot caching working based on your suggestion: https://github.com/ReactiveCircus/android-emulator-runner/pull/159
With a snapshot the Emulator boot time is down to ~15 seconds.
I added a
force-avd-creation
input which when set to false will skip AVD creation if an existing AVD with the sameavd-name
is detected.I saw this which looks interesting: https://discuss.bitrise.io/t/android-emulator-in-90-seconds/1181.
Basically they cache the snapshot of a ‘clean booted’ emulator. Then restart the emulator with
-no-snapshot-save
to actually run the tests.