Issue
I use Travis to run my JUnit tests on Android via the emulator. This works very well so far. However, how can I determine what the latest version of sdk-tools-linux-*.zip is? Currently, I am using version 4333796. Are there any dependencies between the SDK tools version and the Android SDK version or the build tools version?
- name: Tests on Android
jdk: openjdk8
env:
- ANDROID_TOOLS=4333796
- ANDROID_SDK_VERSION=29
- ANDROID_BUILD_TOOLS_VERSION=29.0.3
- ANDROID_HOME=$HOME/android-sdk
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools:${PATH}
before_install:
- sudo apt-get install -y --no-install-recommends bridge-utils libpulse0 libvirt-bin qemu-kvm virtinst ubuntu-vm-builder > /dev/null
- sudo apt-get install -y libxtst6 libnss3-dev libnspr4 libxss1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libgdk-pixbuf2.0-0 > /dev/null
- sudo adduser $USER libvirt
- sudo adduser $USER kvm
- wget -q "https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_TOOLS}.zip" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- wget -q "https://raw.githubusercontent.com/mmcc007/test_emulators/master/script/android-wait-for-emulator.sh" -O android-wait-for-emulator
- chmod +x android-wait-for-emulator gradlew
- touch $HOME/.android/repositories.cfg
- yes | sdkmanager --licenses > /dev/null
install:
- sdkmanager "platform-tools" > /dev/null
- sdkmanager "tools" > /dev/null
- sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" > /dev/null
- sdkmanager "platforms;android-${ANDROID_SDK_VERSION}" > /dev/null
- sdkmanager "extras;android;m2repository" > /dev/null
- sdkmanager "system-images;android-${ANDROID_SDK_VERSION};default;x86" > /dev/null
- sdkmanager "emulator" > /dev/null
- echo no | avdmanager create avd --force -n test -k "system-images;android-${ANDROID_SDK_VERSION};default;x86"
before_script:
- sudo -E sudo -u $USER -E bash -c "${ANDROID_HOME}/emulator/emulator -avd test -no-window -no-audio &"
- ./android-wait-for-emulator
script:
- TERM=dumb ./gradlew createDebugCoverageReport -Dorg.gradle.daemon=false
Solution
Easy!
The latest version will always be 4333796 because sdk-tools is deprecated. If you want to use the new approach, use commandlinetools-linux instead :)
Answered By - Iscle
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.