如何在命令行上安装 Android SDK Build Tools? [英] How to install Android SDK Build Tools on the command line?

查看:35
本文介绍了如何在命令行上安装 Android SDK Build Tools?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过命令行设置安卓开发环境,遇到如下问题:

I want to setup the Android dev environment from command line, and encounter the following issue:

wget http://dl.google.com/android/android-sdk_r22.0.5-linux.tgz

解压后运行

tools/android update sdk --no-ui

但是运行起来太慢了

Fetching https://dl-ssl.google.com/android/repository/addons_list-2.xml

结果是 build-tools 文件夹中没有任何内容,我想要的是 aapt 和 apkbuilder,因为我想在没有 ant 的情况下从命令行构建 apk.

The result is that nothing in folder build-tools, and I want is aapt and apkbuilder, since I want to build apk from command line without ant.

推荐答案

默认情况下,命令行中的 SDK 管理器不包括列表中的构建工具.它们属于过时"类别.要查看所有可用下载,请使用

By default, the SDK Manager from the command line does not include the build tools in the list. They're in the "obsolete" category. To see all available downloads, use

android list sdk --all

然后要从命令行获取该列表中的包之一,请使用:

And then to get one of the packages in that list from the command line, use:

android update sdk -u -a -t <package no.>

其中-u 代表--no-ui,-a 代表--all,-t 代表--filter.

Where -u stands for --no-ui, -a stands for --all and -t stands for --filter.

如果您需要安装多个软件包,请执行以下操作:

If you need to install multiple packages do:

android update sdk -u -a -t 1,2,3,4,..,n 

其中 1,2,..,n 是上面列表命令列出的包号

Where 1,2,..,n is the package number listed with the list command above

这篇关于如何在命令行上安装 Android SDK Build Tools?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆