我需要在我的android存储库中实现Travis-CI的帮助。
我的项目是用SDK 25编译的,但向下兼容版本21。
如何更改我的.travis.yml以运行与该SDK版本兼容的android仿真器?
.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
现在,它使用“没有连接的设备”-Error退出,这是有意义的,因为没有运行模拟器。但是当我使用android-22仿真器尝试时,它也出现了一个错误,比如"Android SDK 22未安装“。
编辑:-- travis.yml中的注释行没有工作,这就是它们被注释掉的原因。
发布于 2017-02-26 16:26:02
对于我们在项目中拥有的这些属性:
compileSdkVersion 25
minSdkVersion 21
targetSdkVersion 25
我们使用这样的模拟器:
echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a --skin 480x800
在travis.yml中,除下列事项外,不需要特殊的代理:
- tools
- platform-tools
- build-tools-25.0.1
- android-25
- extra-android-m2repository
下面是使用min 19的出库:https://github.com/elpassion/el-peon-android
发布于 2017-02-26 23:27:09
我只回答Androd-22部分,因为我没有在最近版本的Android中使用Travis-ci:
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
- build-tools-25.0.0
- android-25
- android-22 # Android platform used by your alternative emulator
- sys-img-armeabi-v7a-android-22
before_script:
- 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
https://stackoverflow.com/questions/42385865
复制相似问题