且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

有没有办法在 Travis CI 构建中启动 android 模拟器?

更新时间:2023-02-25 13:30:03

根据 Travis CI 文档,您可以在 .travis.yml 中使用以下脚本启动模拟器:

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 &

components中指定你需要的系统镜像即可.

Just specify the system image you need in components.