android-emulator-runner icon indicating copy to clipboard operation
android-emulator-runner copied to clipboard

Stable emulator system images

Open yschimke opened this issue 3 years ago • 4 comments

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

yschimke avatar Feb 22 '22 11:02 yschimke

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😀

ychescale9 avatar Feb 22 '22 11:02 ychescale9

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.

yschimke avatar Feb 22 '22 12:02 yschimke

Thanks, I'll take a closer look this weekend.

ychescale9 avatar Feb 22 '22 12:02 ychescale9

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

ychescale9 avatar Mar 04 '22 06:03 ychescale9