Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Android SDK Build Tools on the command line?

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 

after extract the file, run

tools/android update sdk --no-ui 

However, it is too slow on running

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

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.

like image 746
Zhenguo Yang Avatar asked Jul 31 '13 06:07

Zhenguo Yang


People also ask

How install Android SDK build tools manually?

Install the SDKClick Tools > SDK Manager. In the SDK Platforms tab, select Android 12. In the SDK Tools tab, select Android SDK Build-Tools 31. Click OK to install the SDK.

What is Android SDK command line tools?

The sdkmanager is a command line tool that allows you to view, install, update, and uninstall packages for the Android SDK. If you're using Android Studio, then you do not need to use this tool and you can instead manage your SDK packages from the IDE.

How do I install SDK Manager build tools?

To open the SDK Manager from Android Studio, click Tools > SDK Manager or click SDK Manager in the toolbar. If you're not using Android Studio, you can download tools using the sdkmanager command-line tool. When an update is available for a package you already have, a dash appears in the check box next to the package.


1 Answers

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.> 

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 

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

like image 163
nsg Avatar answered Sep 21 '22 01:09

nsg