File tree 2 files changed +15
-3
lines changed
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 && \
23
23
24
24
COPY scripts/android-sdk.sh /scripts/
25
25
RUN . /scripts/android-sdk.sh && \
26
- download_and_create_avd 4333796 armeabi-v7a 18
26
+ download_and_create_avd 4333796 armeabi-v7a 18 5264690
27
27
28
28
ENV PATH=$PATH:/android/sdk/emulator
29
29
ENV PATH=$PATH:/android/sdk/tools
Original file line number Diff line number Diff line change @@ -20,11 +20,19 @@ download_sysimage() {
20
20
# The output from sdkmanager is so noisy that it will occupy all of the 4 MB
21
21
# log extremely quickly. Thus we must silence all output.
22
22
yes | sdkmanager --licenses > /dev/null
23
- yes | sdkmanager platform-tools emulator \
23
+ yes | sdkmanager platform-tools \
24
24
" platforms;android-$api " \
25
25
" system-images;android-$api ;default;$abi " > /dev/null
26
26
}
27
27
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
+
28
36
create_avd () {
29
37
abi=$1
30
38
api=$2
@@ -40,11 +48,12 @@ download_and_create_avd() {
40
48
download_sdk $1
41
49
download_sysimage $2 $3
42
50
create_avd $2 $3
51
+ download_emulator $4
43
52
}
44
53
45
54
# Usage:
46
55
#
47
- # setup_android_sdk 4333796 armeabi-v7a 18
56
+ # download_and_create_avd 4333796 armeabi-v7a 18 5264690
48
57
#
49
58
# 4333796 =>
50
59
# SDK tool version.
@@ -53,3 +62,6 @@ download_and_create_avd() {
53
62
# System image ABI
54
63
# 18 =>
55
64
# 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