Skip to content

Commit 5f1386d

Browse files
budtmoSrinivasanTarget
authored andcommitted
Edited format to download android SDK (#53)
* Edited format to download android SDK * Fixed unit test * Fixed installation issue
1 parent 1174b20 commit 5f1386d

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

Appium/Dockerfile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,21 +53,24 @@ ENV JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre" \
5353
#=====================
5454
# Install Android SDK
5555
#=====================
56-
ARG SDK_VERSION=25.2.3
57-
ARG ANDROID_BUILD_TOOLS_VERSION=25.0.3
56+
ARG SDK_VERSION=sdk-tools-linux-3859397
57+
ARG ANDROID_BUILD_TOOLS_VERSION=26.0.0
5858
ENV SDK_VERSION=$SDK_VERSION \
5959
ANDROID_BUILD_TOOLS_VERSION=$ANDROID_BUILD_TOOLS_VERSION \
6060
ANDROID_HOME=/root
6161

62-
RUN wget -O tools.zip https://dl.google.com/android/repository/tools_r${SDK_VERSION}-linux.zip && \
62+
RUN wget -O tools.zip https://dl.google.com/android/repository/${SDK_VERSION}.zip && \
6363
unzip tools.zip && rm tools.zip && \
6464
chmod a+x -R $ANDROID_HOME && \
6565
chown -R root:root $ANDROID_HOME
66+
ENV PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin
6667

67-
ENV PATH=$PATH:$ANDROID_HOME/tools
68-
69-
RUN echo y | android update sdk -a -u -t platform-tools,build-tools-${ANDROID_BUILD_TOOLS_VERSION}
68+
# https://askubuntu.com/questions/885658/android-sdk-repositories-cfg-could-not-be-loaded
69+
RUN mkdir -p ~/.android
70+
RUN touch ~/.android/repositories.cfg
7071

72+
RUN echo y | sdkmanager "platform-tools"
73+
RUN echo y | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION"
7174
ENV PATH=$PATH:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools
7275

7376
#====================================

Appium/tests/image.bats

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@
1313
@test 'Verify Android SDK is installed' {
1414
[ $ANDROID_HOME == "/root" ]
1515

16-
android_list_sdk=$(android list sdk)
17-
[[ $android_list_sdk == *"Refresh Sources"* ]]
16+
android_list_sdk=$(sdkmanager --list)
17+
[[ $android_list_sdk == *"Installed packages:"* ]]
18+
[[ $android_list_sdk == *"Available Packages:"* ]]
1819
}
1920

2021
@test 'Verify Appium server is installed' {

0 commit comments

Comments
 (0)