question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using an emulator snapshot?

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
ychescale9commented, Jun 18, 2021

@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 same avd-name is detected.

3reactions
chrisbanescommented, Jun 8, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Take a screenshot | Android Developers
If you are using the emulator, you can take a screenshot from the emulator window by clicking the Take Screenshot button, as shown...
Read more >
how do you save android emulator snapshot? - Stack Overflow
One of the tricks you could do is Save to snapshot once, then Launch from snapshot but don't Save to snapshot after that...
Read more >
4. Using Devices and Emulators - Android Developer Tools ...
The snapshot is a view of your emulator including all data, the current UI being displayed, or any other sensor or data currently...
Read more >
Android Emulator Snapshots - bencoding
The Android emulator snapshot enables the ability to save and restore its state to a 'snapshot' file in each AVD – so you...
Read more >
Take a Screenshot of Emulator or Physical Device Like Pro
Hi and welcome to another tutorial from CodingDemos :)Today you will learn how to use Android Studio to take a screenshot using an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found