具有模拟器的Android SDK 25的Travis-CI实现 [英] Travis-CI implementation of Android SDK 25 with Emulator
问题描述
我需要在我的Android系统信息库中实施Travis-CI的帮助.
I need help with implementing Travis-CI in my android repository.
我的项目使用SDK 25进行编译,但向下兼容版本21.
My Project is compiled with SDK 25 but is downwards compatible to Version 21.
如何更改.travis.yml以运行与该SDK版本兼容的android仿真器?
How do I have to change my .travis.yml to run an android emulator thats compatible with that SDK Version?
.travis.yml:
.travis.yml:
language: android
jdk: oraclejdk8
android:
components:
- tools # to get the new `repository-11.xml`
- tools # see https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943)
- platform-tools
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-19
- build-tools-25.0.0
- android-25
# - sys-img-armeabi-v7a-android-22
before_script:
#- android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-25,sys-img-x86_64-android-25
# - echo no | android create avd --force -n test -t android-22 --abi armeabi-v7a
# - emulator -avd test -no-skin -no-audio -no-window &
# - android-wait-for-emulator
# - adb shell input keyevent 82 &
script:
# - ./gradlew build connectedCheck
现在,它退出并显示没有连接的设备"-错误,这是有道理的,因为没有仿真器在运行.但是,当我使用android-22模拟器尝试它时,它也崩溃了,并显示诸如未安装Android SDK 22"之类的错误
Right now it exits with the "no connected devices"-Error, which makes sense, because there is no emulator running. But when I tried it using the android-22 emulator it also crashed with an error like "Android SDK 22 not installed"
travis.yml中的注释行不起作用,这就是为什么它们被注释掉的原因.
The commented lines in the travis.yml didn't work, that's why they are commented out.
推荐答案
对于我们项目中具有的此类属性:
For such properties that we have in our project:
compileSdkVersion 25
minSdkVersion 21
targetSdkVersion 25
我们使用这样的模拟器:
We use such emulator:
echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a --skin 480x800
travis.yml不需要特殊的deps,除了:
No special deps are required in travis.yml besides:
- tools
- platform-tools
- build-tools-25.0.1
- android-25
- extra-android-m2repository
以下是带有最低SDK 19的存储库: https://github.com/elpassion/el-peon-android
Here is out repository with min SDK 19: https://github.com/elpassion/el-peon-android
这篇关于具有模拟器的Android SDK 25的Travis-CI实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!