Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexttransisland/e8ebb98f769d31d7d0a0111550eb4bd8 to your computer and use it in GitHub Desktop.
Save alexttransisland/e8ebb98f769d31d7d0a0111550eb4bd8 to your computer and use it in GitHub Desktop.
Run Android emulator on CircleCI 2.0 macOS
android_run_cucumber:
macos:
xcode: "9.4.0"
shell: /bin/bash --login -eo pipefail
working_directory: /tmp/workspace
steps:
- checkout
- run:
name: Setup environment variables
command: |
echo 'export PATH="$PATH:/usr/local/opt/node@8/bin:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin:/usr/local/share/android-sdk/tools/bin"' >> $BASH_ENV
echo 'export ANDROID_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export ANDROID_SDK_HOME="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export ANDROID_SDK_ROOT="/usr/local/share/android-sdk"' >> $BASH_ENV
echo 'export QEMU_AUDIO_DRV=none' >> $BASH_ENV
echo 'export JAVA_HOME=/Library/Java/Home' >> $BASH_ENV
- run:
name: Install Android sdk
command: |
brew tap homebrew/cask
brew cask install android-sdk
- run:
name: Install emulator
command: (yes | sdkmanager "platform-tools" "platforms;android-26" "extras;intel;Hardware_Accelerated_Execution_Manager" "build-tools;26.0.0" "system-images;android-26;google_apis;x86" "emulator" --verbose) || true
- run:
name: Install packages for appium
command: |
brew uninstall --ignore-dependencies node icu4c
brew install postgresql
brew install node@8
brew link --force --overwrite node@8
npm install -g [email protected]
- run:
name: Run appium
command: appium
background: true
- run: avdmanager create avd -n Pixel_2_API_26 -k "system-images;android-26;google_apis;x86" -g google_apis -d "Nexus 5"
- run:
name: Run emulator in background
command: /usr/local/share/android-sdk/tools/emulator @Pixel_2_API_26 -skin 1080x2066 -memory 2048 -noaudio
background: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment