一个命令行实用程序,用于保持您的android依赖项是最新的。
android-sdk-updater的Python项目详细描述
在无人值守环境中保持android sdk依赖项最新的工具。把它传给你
$ANDROID_HOME
并让它在新版本发布时更新已安装的sdk包。(可选)提供
启动环境或确保
已为下一次CI运行安装最新的依赖项集。
此工具对于持续集成服务器特别有用。
为什么我需要这个?
sdk提供的命令行工具对于无人值守的使用不是特别有用。其他问题包括:
- 没有内置方法列出已安装的包。这可能是因为没有 提供的已安装包的易用索引,因此sdk管理器依赖于目录扫描和 叫曼格林。顺便说一下,这个工具也是。
- 当最新版本已经存在时,某些软件包不必要地下载并重新安装,而没有押韵或理由 安装。
- 有些包是not在增量更新可用时自动更新的。
- 包安装程序需要stdin的输入才能实际安装包,因为它假定 接受软件许可证。
此工具执行确定所需的所有粗粒度扫描、损坏、分析和输入伪造:
- 您安装的软件包及其修订版。
- 可从官方更新站点获得的包及其修订版。
- 由于可用的修订缓冲而应更新的本地包。
- 安装程序运行后,实际安装了哪些软件包,但安装失败。
免责声明
使用此工具,您将确认下载的组件的关联许可证在 代表你。在使用此工具之前,您必须已接受这些组件的相应许可证。
要求
使用python版本2.7和3.5进行测试。
依赖关系:
jprops
pexpect
semantic_version
安装
使用pip
:
$ pip install android-sdk-updater
来源:
$ git clone https://github.com/tadfisher/android-sdk-updater.git $ cd android-sdk-updater $ python setup.py install
用于开发:
$ python setup.py develop
用法
usage: android-sdk-updater [-h] [-v] [-a ANDROID_HOME] [-d] [-t TIMEOUT] [-vv] [-o ...] [-s {available,installed,updates}] [package [package ...]] Update an Android SDK installation positional arguments: package name of SDK package to install if not already installed optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -a ANDROID_HOME, --android-home ANDROID_HOME the path to your Android SDK -d, --dry-run compute packages to install but do not install anything -t TIMEOUT, --timeout TIMEOUT timeout in seconds for package installation, or 0 to wait indefinitely (default) -vv, --verbose show extra output from android tools -o ..., --options ... options to pass to the "android" tool; must be the final option specified -s {available,installed,updates}, --show {available,installed,updates} Show available or installed packages
附加的空格分隔的package
参数可以通过管道传递到标准输入上的此工具。
示例
对$ANDROID_HOME
:
$ android-sdk-updater
对/foo/sdk
:
$ android-sdk-updater --android-home=/foo/sdk
更新$ANDROID_HOME
中的所有包,并确保安装包android-23
和
extra-google-google_play_services
:
$ android-sdk-updater android-23 extra-google-google_play_services
更新ANDROID_HOME
中的所有包,并确保安装文件中包含的包:
$ cat packages.txt tools platform-tools build-tools-23.0.2 android-23 addon-google_apis-google-23 extra-android-m2repository extra-google-m2repository extra-android-support extra-google-google_play_services sys-img-x86_64-addon-google_apis-google-23 $ cat packages.txt | android-sdk-updater
同上,但通过代理:
$ cat packages.txt | android-sdk-updater -o --no-https --proxy-host example.com --proxy-port 3218
显示已安装的软件包、可用的软件包或包含更新的软件包:
$ android-sdk-updater -s installed $ android-sdk-updater -s available $ android-sdk-updater -s updates
注意事项
不支持android ndk。我们计划在将来的版本中支持安装和更新ndk。在 同时,您可能会看到包含以下内容的输出:
Ignoring 'ndk-bundle' as it is blacklisted.
可以安全地忽略这些警告。
许可证
Copyright 2016 Tad Fisher Copyright 2016 Tristan Waddington Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.