I have adb 的 python 包装库 https://github.com/vmalyi/adb-lib我有依赖于模拟器或真实设备的单元测试(因为它们执行 adb 命令)。
我还想使用 Travis CI 作为构建环境,并为每个构建执行这些单元测试。
有没有办法在 Travis CI 中以某种方式提供 android 模拟器,以便单元测试可以执行 adb 命令?
提前致谢!
根据Travis CI 文档 http://docs.travis-ci.com/user/languages/android/#How-to-Create-and-Start-an-Emulator,您可以使用以下脚本启动模拟器.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
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)