Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to start android emulator in Travis CI build?

I have python wrapper-library for adb where I have unit-test which depend on emulator or real device (since they execute adb commands).

I want also to use Travis CI as build environment along with executing those unit tests for each build.

Is there a way to have android emulator available somewhow in Travis CI, so that unit tests can execute adb commands?

Thanks in advance!

like image 665
Viktor Malyi Avatar asked Apr 14 '15 08:04

Viktor Malyi


1 Answers

According to the Travis CI documentation, you can start an emulator with the following script in your .travis.yml:

# Emulator Management: Create, Start and Wait
before_script:
  - echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a
  - emulator -avd test -no-skin -no-audio -no-window &
  - android-wait-for-emulator
  - adb shell input keyevent 82 &

Just specify the system image you need in components.

like image 107
Bruno Parmentier Avatar answered Nov 14 '22 23:11

Bruno Parmentier