How do I download the Android SDK without downloading Android Studio?
Asked Answered
U

13

267

As of the moment, I am running a Windows 8.1 PC that does not have the storage or the RAM for a IDE like Android Studio or Eclipse. I want to download the Android SDK tools, without the IDE. How can this be accomplished?

Unregenerate answered 29/5, 2016 at 2:54 Comment(4)
Short answer: by installing SDK 24 and then update it to 27 as explained here.Sarcoma
@xavier_fakerat I've updated the post and included the links with instruction to upvote your answer if found useful, thanks for your original post. Notice I haven't copied a single sentence, only took some DL links. ;)Sarcoma
@Sarcoma Thanks, note I didn't mean you copied the content but just that the workaround was as useful and informative and it has to be linked to one on the stack overflow siteMarelda
To run devices and sdk go trough : https://mcmap.net/q/103408/-how-to-open-the-avd-manager-on-ubuntu-linux-from-the-command-lineAdjournment
B
237

You can find the command line tools at the downloads page under the "Command line tools only" section.

command line tools section in the downloads page

These are the links provided in that page as of now (version 2022.1.1.20):

Be sure to have read and agreed with the terms of service before downloading any of the command line tools.

The installer version for windows doesn't seem to be available any longer, this is the link for version 24.4.1:

Basset answered 29/5, 2016 at 3:0 Comment(12)
This solution used to work, but as of today, the standalone SDK package for the current version r25.2.3 is no longer available.Coleen
looks like there won't be an installer for future versionsBasset
What am I supposed to do with this new download? There's only a bunch of batch files in it which seem to do nothing.Awning
+1. I already got an installation of Intellij and want to download only the SDK, and the new versions of the tools doesn't seems to integrate withArmenian
@RayKoopa see Tom's answer belowDianadiandra
I am very sad to see the installer gone. :(Lanellelanette
@MrD but there will always be workarounds :):https://mcmap.net/q/103409/-how-to-install-the-gui-android-sdk-manager-without-installing-android-studioMarelda
@Shiki have you tried this already?Marelda
The GUI was deprecated and removed starting with SDK tools v25. To get the GUI, install v24 and update them as explained here.Sarcoma
@andreszs, Deprecating GUI and replacing it with console command is an interesting choice from Google and it is called advancing backwardSequester
Looks like a case when link to download official SDK tools is more easy to find on StackOverflow rather than in official documentation >:|Gonyea
It doesn´t workSenary
Z
118

Navigate to the "Get just the command line tools" section of the android downloads page, and download the tools for your system.

For Windows:

Extract the contents to C:\Android\android-sdk

Navigate to C:\Android\android-sdk\tools\bin and open a command line window
(shift + right click)

Run the following to download the latest android package:

sdkmanager "platforms;android-25" 

Update everything

sdkmanager --update

Other operation systems Do pretty much the same, but not using windows directories.

The sdkmanager page gives more info in to what commands to use to install your sdk.

Zendavesta answered 11/2, 2017 at 18:14 Comment(3)
sdkmanager is not downloading any platform for me. It says "done" but when I check back, it is not there.Hillegass
$ ./sdkmanager "platforms;android-29" Warning: Could not create settings java.lang.IllegalArgumentException at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.<init>(SdkManagerCliSettings.java:428) at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:152) at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.createSettings(SdkManagerCliSettings.java:134) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57) at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)Fasten
@Fasten Passing --sdk_root=${ANDROID_HOME} or --sdk_root=%ANDROID_HOME% (Batch) resolves the error here.Hygroscopic
F
41

Command-line approach

mkdir android-sdk
cd android-sdk
wget https://dl.google.com/android/repository/sdk-tools-linux-*.zip
unzip sdk-tools-linux-*.zip
tools/bin/sdkmanager --update

When executing the above commands, make sure that you replace * with an appropriate version number which you could find in the download page.

Installing packages

You can also use the sdkmanager to list and to install any specific packages needed.

tools/bin/sdkmanager --list
tools/bin/sdkmanager "platform-tools" "platforms;android–27" "build-tools;27.0.3"

FYI

sdk-tools-linux-*.zip only includes the command-line tools. This extracts content to a single directory named tools, like:

+- android-sdk
    +- tools

To get the SDK packages we could run:

tools/bin/sdkmanager --update

The sdkmanager accepts the following flag:

--sdk_root=<sdkRootPath>: Use the specified SDK root instead of the SDK 
                          containing this tool

But if we omit this flag, it assumes parent directory of tools directory as the sdk root, here in our case android-sdk directory.

If you check the android-sdk folder after running tools/bin/sdkmanager --update it will be like:

+- android-sdk
    +- tools
    +- emulator  
    +- platforms  
    +- platform-tool

If needed, also set ANDROID_HOME environment variable like:

export ANDROID_HOME=/path/to/android-sdk
Freestone answered 19/3, 2018 at 7:15 Comment(6)
This anser wi required if the accepted answer is correct alone that is of to no use...Jargon
@Jargon The downloaded version only contains the bare minimum packages. This answer provides details on how to properly update it, so that it actually works.Freestone
Note: @GayanWeerakutti _https://dl.google.com/android/repository/sdk-tools-linux-*.zip_ SDK Tools package is deprecated and no longer receiving updates. Instead, we would required to use the new command-line tools package in pace of it.Tepefy
This solved my problem. But to work properly I had to do this https://mcmap.net/q/66457/-android-command-line-tools-sdkmanager-always-shows-warning-could-not-create-settings renaming the unzipped directory to cmdline-toolsAustreng
I had to rename the directory on unzip. See this answer: https://mcmap.net/q/66972/-cmdline-tools-could-not-determine-sdk-rootInduce
note that you must rename cmdline-tools to tools, and then place that in a new folder called cmdline-tools, such that it is C:\Android\cmdline-tools\tools\bin\... as per #65262840Tolley
M
17

This tutorial is a just step by step for installing Android SDK (Software Development Kit) assuming the user is starting from scratch.

There are just a couple of prerequisites to note:

  • Java runtime environment (or JDK) at Oracle website (and download the correct version (32- or 64-bit) for your computer).
  • A good internet connection (needed for downloading system images etc)

I recommed using the offline SDK installer for installing the essential tools namely SDK and AVD manager: The last version of he installer is found here: SDK Installer_r24.4.1 (for windows), SDK Installer_r24.4.1 (for linux) or SDK Installer_r24.4.1 (for macos)

For this guide I was using windows:

Here is the workthrough:

  • Depending on your choice download the appropriate SDK package from above links (but for this example I will be using the manual method)
  • After downloading the package, begin installation (and choose the desired installation folder to proceed or just leave the default %USERPROFILE%\android-sdk):

enter image description here

  • When done leave the option to download system images "checked":

enter image description here

Now we're in business...

  • The SDK manager window will appear, now you need to update/download other sdk packages (i.e platform-tools, system-images, platforms etc according to API levels)

enter image description here

Note: I recommend downloading x86 images as they're much faster tham arm counterparts, also get intel HAXM (hardware accelerated execution manager) driver to significantly increase your emulator speed

  • All set, now you just need to create and configure an Android virtual device matching your target Android version and tweak desired settings.

  • To do this click on the Tools tab in SDK manager and select manage AVDs, then in the following window click Create you'll see a similar screen as below:

enter image description here

  • After that boot the newly created virtual device.

enter image description here

  • Install applications and test as you wish ..
Marelda answered 19/7, 2018 at 18:10 Comment(1)
used to install android-sdk in Feb 2021. thanks!Carnage
X
16

What worked for me on Windows:

  1. Downloaded command line tools from https://developer.android.com/studio/index.html
  2. Put the whole tools folder from the ZIP archive to C:\Program Files (x86)\Android SDK\
  3. Launched tools\android.bat as administrator, which opened the usual SDK Manager window
  4. Installed required components. The files were downloaded to ...\Android SDK\ directory (that is build-tools, platforms, platform-tools, etc. directories appeared alongside tools inside ...\Android SDK\)
  5. Opened the Android project in Intellij IDEA, navigated to File->Project Structure->SDKs, and added Android SDK by directing to ...\Android SDK\ directory
Xever answered 30/3, 2017 at 13:9 Comment(5)
I launched the tools/android.bat as admin but it didn't open the SDK Manager window as you describedDianadiandra
@Dianadiandra try launching the android.bat from a Command Prompt (CMD). This might give some details why the SDK Manager window isn't appearing.Xever
@Xever Thanks for the advice. I ended up downloading the older version of the installer provided by Mr D (above), still works fine.Dianadiandra
The GUI was deprecated and removed starting with SDK tools v25. To get the GUI, install v24 and update them as explained here.Sarcoma
Current download, commandlinetools-win-6858069_latest.zip, does not include a tools directoryCarnage
Q
7

Command line only without sdkmanager (for advanced users / CI):

You can find the download links for all individual packages, including various revisions, in the repository XML file: https://dl.google.com/android/repository/repository-12.xml

(where 12 is the version of the repository index and will increase in the future).

All <sdk:url> values are relative to https://dl.google.com/android/repository, so

<sdk:url>platform-27_r03.zip</sdk:url>

can be downloaded at https://dl.google.com/android/repository/platform-27_r03.zip

Similar summary XML files exist for system images as well:

Quantity answered 15/3, 2019 at 13:48 Comment(1)
Hm. Nice find. NDK download seems to be available this way as well. For instance, I found https://dl.google.com/android/repository/android-ndk-r21-darwin-x86_64.zipBendy
U
6

For those using the latest distribution on windows, the following should be enough:

  1. Download the command line tools from here
  2. Extract it somewhere (e.g. C:\androidsdk)
  3. Add ANDROID_SDK_TOOLS as environment variable pointing to where you extracted it (C:\androidsdk)
  4. Create a folder named latest inside the cmdline-tools you extracted. And move what's inside(bin,lib...) to the folder latest.
  5. cd cmdline-tools/latest/bin and execute the following:

sdkmanager.bat system-images;android-29;default;x86_64 platforms;android-29 build-tools;29.0.3 extras;google;m2repository extras;android;m2repository

  1. Agree to the terms and conditions and continue. voilà
Undermost answered 4/12, 2020 at 20:55 Comment(0)
T
5

Well the folks who are trying to download either on *ix or Ec2 machine would suggest to clean approach in below steps:

$ mkdir android-sdk
$ cd android-sdk
$ mkdir cmdline-tools
$ cd cmdline-tools
$ wget https://dl.google.com/android/repository/commandlinetools-linux-*.zip
$ unzip commandlinetools-linux-*.zip

The king - sdkmanager lives inside

cmdline-tools/tools/bin

, you'd better set in PATH environment variable.

but cmdline-tools should not be set as ANDROID_HOME. Because later, when updating Android SDK, or installing more packages, the other packages will be placed under ANDROID_HOME, but not under cmdline-tools.

The final, complete ANDROID_HOME directory structure should look like below, consist of quite a few sub-directories:

build-tools, cmdline-tools, emulator, licenses, patcher, platform-tools, platforms, tools. You can easily point out that build-tools and cmdline-tools are siblings, all resides inside the parent ANDROID_HOME.

Add SDK tools directory in PATH environment variable to make executable available globally. Add below line either in ~/.bashrc or ~/.profile file to make it permanent.

In order to edit the ~/.bashrc simply can be editable in vim mode

$ vim .bashrc

Now set your preferred ANDROID_HOME in .bashrc file :

export ANDROID_HOME=/home/<user>/android-sdk
export PATH=${PATH}:$ANDROID_HOME/cmdline-tools/tools/bin:$ANDROID_HOME/platform-tools

here strange thing that we haven't download the platform-tools directory as of now but mentoning it under path but let it be as it will help you avoid remodification on the same file later.

Now go inside the same directory:

$ cd android-sdk

NOTE: well in first attempt sdkmanager command didnt found for me so I close the terminal and again created the connection or you can also refresh the same if it works for you.

after that use the sdkmanager to list and install the packages needed:

$ sdkmanager "platform-tools" "platforms;android-27" "build-tools;27.0.3"

Hence Sdkmanager path is already set it will be accessible from anywhere:

$ sdkmanager --update


$ sdkmanager --list
Installed packages:=====================] 100% Computing updates...             
  Path                 | Version | Description                    | Location             
  -------              | ------- | -------                        | -------              
  build-tools;27.0.3   | 27.0.3  | Android SDK Build-Tools 27.0.3 | build-tools/27.0.3/  
  emulator             | 30.0.12 | Android Emulator               | emulator/            
  patcher;v4           | 1       | SDK Patch Applier v4           | patcher/v4/          
  platform-tools       | 30.0.1  | Android SDK Platform-Tools     | platform-tools/      
  platforms;android-27 | 3       | Android SDK Platform 27        | platforms/android-27/
Tepefy answered 31/5, 2020 at 17:26 Comment(0)
S
4

Install latest version from CLI without specifying version

Here is an approach to downloading the last version of the Android SDK from CLI.

First of all, create and move to the following dir:

mkdir -p ~/android-sdk/cmdline-tools
cd ~/android-sdk/cmdline-tools

Then download the SDK (it basically finds the download URL from the HTML and downloads it, if you go to the web page, you'll see that it only shows the last one, so it works):

curl -s https://developer.android.com/studio\#command-tools | grep -Eo 'https://dl.google.com/android/repository/commandlinetools-mac-[0-9]*_latest.zip' | head -n 1 | xargs wget

Unzip file

ls -A1 | xargs unzip
Subgenus answered 6/9, 2022 at 23:0 Comment(0)
A
0

Sadly, straight from google, which is where you will want to download if your company firewall blocks other sources, Release 1.6 r1 September 2009 is the latest SDK they have.

Alic answered 17/7, 2019 at 9:29 Comment(0)
T
0

To download the SDK over command line, the link has changed slightly than previously mentioned:

wget --quiet --output-document=/tmp/sdk-tools-linux.zip https://dl.google.com/android/repository/commandlinetools-linux-${ANDROID_SDK_TOOLS}.zip

Latest version listed on the downloads page.

Treytri answered 30/5, 2020 at 1:49 Comment(0)
B
0

If you download the file https://dl.google.com/android/repository/repository2-2.xml you got the links to all SDKs and Source codes for all API versions. This data is also used by the SDK Manager.

If you search for Android SDK Platform 32 for example, you see also the XML tag url with the value platform-32_r01.zip. You can download this SDK file then from https://dl.google.com/android/repository/platform-32_r01.zip

Bagging answered 12/9, 2023 at 7:57 Comment(0)
E
-3

I downloaded Android Studio and installed it. The installer said:-

Android Studio => ( 500 MB )

Android SDK => ( 2.3 GB )

Android Studio installer is actually an "Android SDK Installer" along with a sometimes useful tool called "Android Studio".

Most importantly:- Android Studio Installer will not just install the SDK. It will also:-

  • Install the latest build-tools.
  • Install the latest platform-tools.
  • Install the latest AVD Manager which you cannot do without.

Things which you will have to do manually if you install the SDK from its zip file.

Just take it easy. Install the Android Studio.

****************************** Edit ******************************

So, being inspired by the responses in the comments I would like to update my answer.

The update is that only (and only) if 500MB of hard disk space does not matter much to you than you should go for Android Studio otherwise other answers would be better for you.

Android Studio worked for me as I had a 1TB hard disk which is 2000 times 500MB.

Also, note: that RAM sizse should not a restriction for you as you would not even be running Android Studio.

I came to this solution as I was myself stuck in this problem. I tried other answers but for some reason (maybe my in-competencies) they did not work for me. I decided to go for Android Studio and realized that it was merely 18% of the total installation and SDK was 82% of it. While I used to think otherwise. I am not deleting the answers inspite of negative rating as the answer worked for me. I might work for someone elese with a 1 TB hard disk (which is pretty common these days).

Ephod answered 13/9, 2017 at 22:54 Comment(4)
This is far from a solution to OP's problem. He cannot install Android Studio due to system restrictions.Hazard
What I am suggesting is that he should install the whole thing and then just use the SDK without even clicking on the Android Studio's icon. It is just that 'Android Studio' installer makes it easy to install 'Android SDK'. It will only take an extra 500 MB of HDD space. Nothing much.Ephod
OP said he does not have a storage capacity for IDE, so they need to save as much space as possible. Your solution wastes 500 MB completely unnecessary. Android Studio installation is completely unnecessary, check out other answers.Hazard
I understand what you are saying. Actually I did read other answers because I was finding an answer myself. I even tried some answers but things just did not workout for me and I decided to just go for Android Studio. During installation I read that that Android Studio was just 18% of the total installation size and 500 MB did not matter much to me in a 1 TB hard disk. So, the bottom line is that if hard disk space does not matter than you should go for Android Studio. Otherwise other answers would be a better solution. Ram size should not matter. I will just edit my answer accordingly.Ephod

© 2022 - 2024 — McMap. All rights reserved.