Skip to content

Instantly share code, notes, and snippets.

@ivarprudnikov
Created June 28, 2018 08:55
Show Gist options
  • Save ivarprudnikov/ae2459d92a3c1e889ef9b6f8fff588a7 to your computer and use it in GitHub Desktop.
Save ivarprudnikov/ae2459d92a3c1e889ef9b6f8fff588a7 to your computer and use it in GitHub Desktop.
Travis Android emulator setup. Emulator starts but espresso test still fails. Do not twiddle with version numbers as it was quite hard to get it right
language: android
sudo: required
jdk: openjdk8
env:
global:
- ANDROID_API=27
- EMULATOR_API=24
- ANDROID_BUILD_TOOLS=27.0.3
android:
components:
- tools
- android-$EMULATOR_API
- platform-tools
- tools
# The BuildTools version used by your project
- build-tools-$ANDROID_BUILD_TOOLS
# The SDK version used to compile your project
- android-$ANDROID_API
# Additional components
- extra-android-m2repository
- extra-google-m2repository
- sys-img-armeabi-v7a-android-$EMULATOR_API
licenses:
- ".+"
before_install:
- yes | sdkmanager "platforms;android-${ANDROID_API}"
# Emulator Management: Create, Start and Wait https://docs.travis-ci.com/user/languages/android#How-to-Create-and-Start-an-Emulator
before_script:
- echo "y" | android update sdk -a --no-ui --filter android-$EMULATOR_API
- echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-$EMULATOR_API
- echo no | android create avd --force -n test -t android-$EMULATOR_API --abi armeabi-v7a
- emulator -avd test -no-skin -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
- adb wait-for-device get-serialno
script:
- echo "Travis branch is $TRAVIS_BRANCH"
# test demo flavour
# for me espresso test failed on `onView` check
- ./gradlew connectedDemoDebugAndroidTest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment