Shrimantee Roy
Shrimantee Roy

Reputation: 347

Is there a way we can download Sdk Command line tools from terminal in Linux?

The query is, whether Without Android Studio or SDK Manager GUI is there a way to download SDK command-line tools from the terminal in Linux.

Upvotes: 2

Views: 2546

Answers (2)

Prakshal
Prakshal

Reputation: 31

Firstly install Java

$ sudo yum install java-11-openjdk-devel

If you are using EC2 Instance then

$ sudo amazon-linux-extras install java-openjdk11

Create folder named "android" or "Android"

$ mkdir android
$ cd android

Then download commandline tools

$ wget https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip

Unzip the folder using below command,

$ unzip commandlinetools-linux-8512546_latest.zip

Now create directory named 'latest' in command-line tools

$ cd cmdline-tools/
$ ls
     bin  lib  NOTICE.txt  source.properties
$ mkdir latest

Move mentioned packages in latest directory

$ mv bin/ lib/ NOTICE.txt source.properties latest/

Command to check the version

$ cd cmdline-tools/latest/bin/
$ ./sdkmanager --version

Upvotes: 3

Marc Nadal
Marc Nadal

Reputation: 121

So... read carefully, if you don't understand, check the last part...

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

**I found this answer from other question, In here you can find more information:How to install Android SDK Build Tools on the command line?

Upvotes: 0

Related Questions