Skip to content

Instantly share code, notes, and snippets.

@mmcc007
Created October 11, 2018 21:52
Show Gist options
  • Save mmcc007/b57f64c79d085ecdbda26c22422374d4 to your computer and use it in GitHub Desktop.
Save mmcc007/b57f64c79d085ecdbda26c22422374d4 to your computer and use it in GitHub Desktop.
Android Emulators in the cloud
# sudo: false --> run dist image in docker container on shared host for faster startup (runs slower)
# sudo: required --> run dist image in VM on Google Compute Engine for slower startup (runs faster)
sudo: required
dist: trusty
os:
- linux
- osx
env:
- SYS=25 ABI="google_apis;arm64-v8a"
- SYS=25 ABI="google_apis;armeabi-v7a"
- SYS=24 ABI="google_apis;arm64-v8a"
- SYS=24 ABI="google_apis;armeabi-v7a"
- SYS=23 ABI="google_apis;armeabi-v7a"
- SYS=22 ABI="default;x86" # demo failure due to no accelerator on travis
- SYS=22 ABI="default;x86_64" # demo failure due to no accelerator on travis
- SYS=22 ABI="google_apis;armeabi-v7a"
- SYS=22 ABI="google_apis;x86" # demo failure due to no accelerator on travis
- SYS=22 ABI="google_apis;x86_64" # demo failure due to no accelerator on travis
- SYS=22 ABI="default;armeabi-v7a"
- SYS=21 ABI="default;armeabi-v7a"
- SYS=20 ABI="default;armeabi-v7a"
- SYS=19 ABI="default;armeabi-v7a"
- SYS=18 ABI="default;armeabi-v7a"
- SYS=17 ABI="default;armeabi-v7a"
- SYS=16 ABI="default;armeabi-v7a"
- SYS=15 ABI="default;armeabi-v7a"
- SYS=14 ABI="default;armeabi-v7a"
- SYS=10 ABI="default;armeabi-v7a"
matrix:
allow_failures:
- env: SYS=22 ABI="default;x86"
- env: SYS=22 ABI="default;x86_64"
- env: SYS=22 ABI="google_apis;x86"
- env: SYS=22 ABI="google_apis;x86_64"
- env: SYS=20 ABI="default;armeabi-v7a"
- env: SYS=14 ABI="default;armeabi-v7a"
language: generic
before_install:
# Install the Android SDK Dependency.
- export ANDROID_HOME=~/android-sdk-linux
- if [ $TRAVIS_OS_NAME == "osx" ]; then wget -q "https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip" -O android-sdk-tools.zip; else wget -q "https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip" -O android-sdk-tools.zip; fi
# - wget -q "https://dl.google.com/android/repository/sdk-tools-${OS}-4333796.zip" -O android-sdk-tools.zip
- unzip -q android-sdk-tools.zip -d ${ANDROID_HOME}
- rm android-sdk-tools.zip
- PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/tools/bin:${ANDROID_HOME}/platform-tools
# Silence warning.
- mkdir -p ~/.android
- touch ~/.android/repositories.cfg
- HOMEBREW_NO_AUTO_UPDATE=1
- if [ $TRAVIS_OS_NAME == "osx" ]; then brew cask uninstall java; brew tap caskroom/versions; brew cask install java8; fi
# Accept licenses before installing components, no need to echo y for each component
- yes | sdkmanager --licenses
# Platform tools
- sdkmanager "emulator" "tools" "platform-tools" > /dev/null
- sdkmanager --list | head -15
# install older packages (for emulator)
- sdkmanager "build-tools;25.0.2" "platforms;android-25" > /dev/null
# Create and start emulator.
- sdkmanager "system-images;android-$SYS;$ABI" > /dev/null
- sdkmanager --list | head -15
- echo no | avdmanager create avd --force -n test -k "system-images;android-$SYS;$ABI"
# fix timezone warning
- if [ $TRAVIS_OS_NAME == "osx" ]; then sudo ln -sf /usr/share/zoneinfo/US/Pacific /etc/localtime; fi
# use the absolute emulator path in case older version installed (on default path)
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window -gpu swiftshader &
before_script:
# Wait for emulator to startup.
- ./scripts/android-wait-for-emulator.sh
- adb shell input keyevent 82
script:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment