我认为您已经不需要它,但我会尝试回答这个问题。
您需要添加--all
标志,否则这些包不可用。
Google 已弃用该-p --obsolete
标志,并且只有建议的(较新的)包不带-a --all
标志可用。
请参阅缺少的构建工具 - 第 56 行
echo "y" | android update sdk --filter platform-tools,build-tools-17.0.0,android-16,extra-android-support,$ANDROID_SDKS --no-ui --force > /dev/null
Error: Missing platform-tools
Error: Missing platform-tools
Error: Ignoring unknown package filter 'build-tools-17.0.0'
目前建议使用最新的平台工具,但始终不带--all
标志,但:
$ ./android update sdk -u -t build-tools-17.0.0
Error: Ignoring unknown package filter 'build-tools-17.0.0'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
$ ./android update sdk -a -u -t build-tools-17.0.0
Packages selected for install:
- Android SDK Build-tools, revision 17
可能缺少构建工具和 android-17 平台是找不到属性文件的原因。
我在这里看到了 travis-lint 的解决方法,我不使用它。
这是我用于日志的当前工作,需要改进但适用-e
于模拟器。您需要自定义您的MOD_NAME
.
# adb -e: direct an adb command to the only running emulator. Return an error if more than one.
before_script:
# - echo 'LOGCAT'
# Check logcat debug output: http://developer.android.com/tools/help/logcat.html
# Check debugging log: http://developer.android.com/tools/debugging/debugging-log.html
# Comment the lines belows to debug output and redirect it to a file. Custom tags for your app.
- adb -e logcat *:W | tee logcat.log > /dev/null 2>&1 &
after_failure:
# - echo 'FAILURE'
# Check apt configuration: http://docs.travis-ci.com/user/ci-environment/#apt-configuration
# Comment out the lines below to show log about tests with app name customized on exports section.
- sudo apt-get install -qq lynx
- export MOD_NAME=yourappmodulename
- export LOG_DIR=${TRAVIS_BUILD_DIR}/${MOD_NAME}/build/outputs/reports/androidTests/connected/
- lynx --dump ${LOG_DIR}com.android.builder.testing.ConnectedDevice.html > myConnectedDevice.log
- lynx --dump ${LOG_DIR}com.android.builder.testing.html > myTesting.log
- for file in *.log; do echo "$file"; echo "====================="; cat "$file"; done || true
after_script:
# Uncomment the line below to kill adb and show logcat output.
- echo " LOGCAT "; echo "========"; cat logcat.log; pkill -KILL -f adb
我正在寻找一个预安装的替代方案,lynx
因为sudo
它不能使用基于容器的基础设施,并且cat
真的用于连接文件,如果有人知道改进它,谢谢。