File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ RUN dpkg --add-architecture i386 && \
2323
2424COPY scripts/android-sdk.sh /scripts/
2525RUN . /scripts/android-sdk.sh && \
26- download_and_create_avd 4333796 armeabi-v7a 18
26+ download_and_create_avd 4333796 armeabi-v7a 18 5264690
2727
2828ENV PATH=$PATH:/android/sdk/emulator
2929ENV PATH=$PATH:/android/sdk/tools
Original file line number Diff line number Diff line change @@ -20,11 +20,19 @@ download_sysimage() {
2020 # The output from sdkmanager is so noisy that it will occupy all of the 4 MB
2121 # log extremely quickly. Thus we must silence all output.
2222 yes | sdkmanager --licenses > /dev/null
23- yes | sdkmanager platform-tools emulator \
23+ yes | sdkmanager platform-tools \
2424 " platforms;android-$api " \
2525 " system-images;android-$api ;default;$abi " > /dev/null
2626}
2727
28+ download_emulator () {
29+ # Download a pinned version of the emulator since upgrades can cause issues
30+ curl -fo emulator.zip " https://dl.google.com/android/repository/emulator-linux-$1 .zip"
31+ rm -rf " ${ANDROID_HOME} /emulator"
32+ unzip -q emulator.zip -d " ${ANDROID_HOME} "
33+ rm -f emulator.zip
34+ }
35+
2836create_avd () {
2937 abi=$1
3038 api=$2
@@ -40,11 +48,12 @@ download_and_create_avd() {
4048 download_sdk $1
4149 download_sysimage $2 $3
4250 create_avd $2 $3
51+ download_emulator $4
4352}
4453
4554# Usage:
4655#
47- # setup_android_sdk 4333796 armeabi-v7a 18
56+ # download_and_create_avd 4333796 armeabi-v7a 18 5264690
4857#
4958# 4333796 =>
5059# SDK tool version.
@@ -53,3 +62,6 @@ download_and_create_avd() {
5362# System image ABI
5463# 18 =>
5564# Android API Level (18 = Android 4.3 = Jelly Bean MR2)
65+ # 5264690 =>
66+ # Android Emulator version.
67+ # Copy from the "build_id" in the `/android/sdk/emulator/emulator -version` output
You can’t perform that action at this time.
0 commit comments