SDK Tools, Build Tools, and Platform Tools are all part of the Android Software Development Kit (SDK). The stock Android emulator, hierarchy viewer, SDK manager, and ProGuard are the main parts of the SDK Tools package.
The primary build tools are aapt (an Android packaging tool for creating .APK files) and dx (an Android tool that converts .java files to .dex files). The Android debug shell, sqlite3, and Systrace are all Platform Tools.
Table of Content
Things You Should Know About Android SDK
- The Android SDK can be installed automatically using the most recent version of Gradle, or manually in a variety of ways. An overview of all approaches is provided below.
- Gradle 2.2.0 now supports downloading dependencies automatically when installing the Android SDK. Upgrade to the most recent Gradle version. The Gradle plugin for managing dependencies is no longer supported.
Ubuntu Linux Installation
Install the following packages if you are using Ubuntu 15.04 or 15.10. If you don’t, you might get an error like “No such file or directory” when you try to run the “aapt” program from the Android SDK toolset:
sudo apt-get install libc6-dev-i386 lib32z1 openjdk-8-jdk
1. How to Install The Android SDK via Homebrew
If you’re running macOS/OS X, you can install the Android SDK with Homebrew.
- Install Homebrew, the macOS/OS X package manager.
- Execute these commands:
brew tap homebrew/cask brew install --cask android-sdk
- This will install the Android SDK tools in /usr/local/Cellar/android-sdk/<version number>
2. How to Install The Android SDK Manually
You must obtain the Android SDK without including Android Studio. Navigate to the SDK Tools Only section of the Android SDK. Copy the download URL for your build machine’s operating system.
- Use this command, wget, followed by the correct SDK URL:
$ wget https://dl.google.com/android/repository/tools_r25.2.3-macosx.zip
- Unzip the archive and place the contents in your home directory. The directory names can be whatever you want, but save the files somewhere easy to find (for example, /android-sdk).
- Then, run the sdkmanager tool:
$ tools/bin/sdkmanager --update $ tools/bin/sdkmanager "platforms;android-25" "build-tools;25.0.2" "extras;google;m2repository" "extras;android;m2repository" $ tools/bin/sdkmanager --licenses
- Now is the time to set up your PATH variable and other variables that will be used to find Android in your build environment.
- Change the contents of your .bash_profile file. If you aren’t using bash, modify the appropriate config file for your environment.
# Android export ANDROID_SDK_ROOT=/Users/ciandroid/android-sdk-macosx export PATH=$PATH:$ANDROID_SDK_ROOT/tools
- Save and exit. You need to reload the .bash_profile.
$ source ~/.bash_profile
3. How to Install the Android SDK Using the GUI
- Enter android at the prompt to open the Android SDK Manager in a new window. If this does not work, it is because your PATH variable is not set to the Android SDK location.
- Install the same Android SDK packages on your build machine that you did to get Gradle to run locally. Check the build.gradle file in your project before you begin.
Installing Packages
Here are the SDK package names you should definitely choose:
- Tools > Android SDK Tools
- Tools > Android SDK Platform-tools
- Tools > Android SDK Build-tools
- Android Platform, use one version, e.g., Android 5.1.1 (API 22). It should be the one you named in the android: compileSdkVersion section of your build.gradle file.
You should also get the following extras:
- Android Support Repository
- Android Support Library
Note: If your build.gradle file contains the following information, you must use the Android SDK Build-Tools for the Android version you specified in the build.gradle file as the android: buildToolsVersion target.
android { buildToolsVersion '21' ... }