Quick Tip: Installing the Android SDK

Share this article

This article was peer reviewed by Adrian Sandu. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!

To develop Android apps you will need the Android SDK (Software Development Kit) installed on your machine. As there are several different ways to do so, in this quick tip I will present the options available and why you might want to choose one over another.

Android Studio

The simplest way to install the Android SDK is by downloading Android Studio, the official Android IDE (Integrated Development Environment) from Google and JetBrains. If you plan to create Android applications with cross-platform tools such as Cordova, Ionic or React Native, Android Studio is far more than you need. Or perhaps you need the Android SDK just for building and testing apps built by others. In these cases, installing the standalone SDK is all you need, and again, there are a couple of options.

Java JDK

To install the Android SDK on any platform, you will need a Java JDK installed. Download this from the Oracle website for all major platforms.

Linux

apt-get install sun-java6-jdk

If your distribution is 64-bit, run this command first to install the required x86 libraries:

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386

Installing and Configuring the SDK

Windows

Choose the first option from the download page which will download an .exe file. After the download has finished, double click and start the installation.

You can change the installation location to wherever you want, but for simplicity, leave it as is.

After the installation completes you will need to change the Windows environment variables so the adb (DEFINITION) server can start anywhere.

  1. Open Control Panel
  2. Click System and on the left hand side select, Advanced system settings.
  3. In the Advanced tab, click Environment Variables at the bottom.
  4. Select the PATH variable under the System Variable section.
  5. Select Edit and click New.
  6. Add _;C:\Users\%username%\AppData\Local\Android\android-sdk\tools\;C:\Users\%username%\AppData\Local\Android\android-sdk\platform-tools_ if you didn’t change the location in the installation window. If you did change the location then update C:\Users\%username%\AppData\Local to the new location.

Note: Replace %username% with your account username.

Confirm the changes and you’re ready to use the SDK.

Linux

Download the .tgz file from the Linux section here.

After the download has finished, extract the contents into your Home directory.

Open your ~/.bashrc file or create it if it does not exist. This is a hidden file inside your Home directory. Enable View Menu -> Show hidden files in your file navigator or open from the command line.

Add these lines at the end of the file:

export ANDROID_HOME=/home/<yourusername>/Android/Sdk
export PATH=$PATH:/home/<yourusername>/Android/Sdk/tools

Replacing <yourusername> with your user name.

Save the file and restart your computer or log-out and log-in.

Mac

Download the .zip file from the Mac section here. Extract the android-sdk-macx86_ folder into your home directory for easy access.

Set the PATH variable in the .bashprofile_ file located in your home directory by adding the following lines:

export PATH=/Users/me/android-sdk-mac_86/platform-tools:/Users/me/android-sdk-mac_86/tools:$PATH

Replacing /Users/me with your user name.

Save and reboot your computer for the changes to take effect.

Homebrew

Another great option for Mac users is using Homebrew to install and keep the Android SDK up to date. Install with the standard brew command:

brew install android-sdk

That’s it, you are now ready to use the Android SDK. If you have any questions or comments, please let me know below.

Frequently Asked Questions (FAQs) about Installing the Android SDK

What are the system requirements for installing the Android SDK?

The Android SDK can be installed on Windows, Mac, and Linux operating systems. For Windows, you need to have Windows 7 or later. For Mac, you need to have Mac OS X 10.10 (Yosemite) or higher. For Linux, a GNOME or KDE desktop is recommended. All platforms require a minimum of 3 GB RAM and 2 GB of available disk space, as well as a monitor with a minimum resolution of 1280×800.

How do I update the Android SDK Tools?

To update the Android SDK Tools, you need to open the SDK Manager in Android Studio. From there, you can see a list of the SDK platforms and tools that are available for you to download. Check the boxes for the tools you want to update, and then click “Apply” to start the download and installation process.

What is the Android SDK Platform-Tools package?

The Android SDK Platform-Tools package is a component of the Android SDK. It includes tools that interface with the Android platform, such as adb, fastboot, and systrace. These tools are required to do things like installing and debugging apps, and they are updated whenever a new version of the Android platform is released.

How do I install the Android SDK without Android Studio?

If you prefer not to use Android Studio, you can download the Android SDK command line tools. After downloading the zip file, extract it to a location on your computer. Then, add the tools directory to your PATH environment variable. Finally, open a terminal and run the command “sdkmanager” to download the necessary SDK packages.

What is the Android SDK Build-Tools package?

The Android SDK Build-Tools package is a component of the Android SDK that includes tools for building Android apps, such as aapt, dex, and dx. These tools are used to compile your app’s source code into an APK file that can be installed on an Android device.

How do I use the Android SDK Manager in Visual Studio?

To use the Android SDK Manager in Visual Studio, you need to open the Tools menu and select “Android” > “Android SDK Manager”. From there, you can see a list of the SDK platforms and tools that are available for you to download. Check the boxes for the tools you want to install, and then click “Apply” to start the download and installation process.

How do I install specific versions of the Android SDK?

To install specific versions of the Android SDK, you need to open the SDK Manager in Android Studio. From there, you can see a list of the SDK platforms that are available for you to download. Check the boxes for the platforms you want to install, and then click “Apply” to start the download and installation process.

What is the Android Emulator?

The Android Emulator is a tool included with the Android SDK that allows you to run Android apps on your computer. It emulates an Android device, so you can test your apps in a variety of configurations and environments without needing to have a physical device.

How do I update the Android Emulator?

To update the Android Emulator, you need to open the SDK Manager in Android Studio. From there, you can see a list of the SDK tools that are available for you to download. Check the box for the Android Emulator, and then click “Apply” to start the download and installation process.

How do I troubleshoot problems with the Android SDK?

If you’re having problems with the Android SDK, there are several things you can try. First, make sure that your system meets the requirements for the SDK. Second, make sure that you have the latest versions of the SDK tools installed. Third, check the Android Developers website for any known issues or updates. If you’re still having problems, you can post a question on the Android Developers forum or on Stack Overflow.

Donald DragotiDonald Dragoti
View Author

Donald is a Computer Engineering student who is passionate about mobile and web technology. While his focus is in computer networks, he is proficient in C, Java and constantly learning about web development and security.

android studiochriswIDEquick-tipsdk
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week