android-emulator-runner
android-emulator-runner copied to clipboard
Stable emulator system images
We have a broken test which now seems to be related to a new system image for the wear emulator.
I'm wondering if there is a way to pin the system image (not emulator binary) used? Otherwise there is no guarantee that builds will be stable and reproducible.
https://github.com/android/wear-os-samples/issues/219
We should be able to if we can somehow replicate what the SDK manager does but I'll have to try. The tricky part is figuring out the exact download urls (I still haven't figured out how to retrieve all the emulator binary build numbers).
Thanks for the sponsorship btw😀
From looking at Android Studio SDK manager it uses this repositories
https://dl.google.com/android/repository/sys-img/android-wear/sys-img2-3.xml
Then seems to build in the "android-wear" and "x86-28_r07.zip"
https://dl.google.com/android/repository/sys-img/android-wear/x86-28_r07.zip
PArts.
Thanks, I'll take a closer look this weekend.
Looks like we can download the repository xml files listed under Android Studio's SDK Update Sites and extract the version information to assemble the URL paths.
To pin a system images we just need a major revision and find the matching url suffix e.g. x86-10_r05.zip:
<revision>
<major>4</major>
</revision>
...
<complete>
<size>75386095</size>
<checksum type="sha1">a166d5ccbb165e1dd5464fbfeec30a61f77790d8</checksum>
<url>x86-10_r05.zip</url>
</complete>
For emulator binary looks like we need major, minor, micro:
<revision>
<major>31</major>
<minor>3</minor>
<micro>3</micro>
</revision>
We also need to search from multiple repos depending on the variants of system images required e.g. default, google_apis, google_apis_play_store, google_atd, aosp_atd, android_wear