Development of mobile applications for the most popular operating system in the world begins with preparing the working environment. The central element of this process is Android Software Development Kit, or simply SDK. This set of tools contains everything you need to compile, debug and test code, including emulators, libraries and command line utilities.
Many beginners face difficulties at the first stage, trying to find a reliable download source. There are many mirrors and third-party repositories online, but using unverified files may result in an unstable development environment or security issues. Therefore, it is critically important to understand where the official distribution is located and how to properly integrate it into the system.
In this article we will analyze in detail the process of obtaining tools from Google, consider various installation options - from a full-fledged environment to minimalistic command utilities. You'll learn how to set up environment variables for global access to tools and what components you need to select to start working on a project.
Official sources for downloading tools
The only guaranteed safe and up-to-date source is the official Android developer portal. This is where Google publishes the latest platforms, system images, and build tools. Direct downloading of an isolated SDK package is less common today, as the company has focused on modularity and integration.
There used to be a separate installer Android SDK Tools Only, which allowed you to download a basic set without unnecessary software. Now this approach has been transformed into the use of Command Line Tools. This is a lightweight package that, when launched for the first time, automatically downloads the necessary components through the built-in package manager sdkmanager.
โ ๏ธ Attention: Avoid downloading archives from file hosting services or torrent trackers. SDK versions quickly become outdated, and modified files may contain malicious code that can compromise your project or credentials.
For those who prefer a graphical interface, installing a full-fledged integrated development environment remains the optimal solution. It Android Studio already contains the latest version of the SDK, automatically configured and ready for use immediately after installation. This eliminates the need to manually set paths and manage dependencies at the initial stage.
If you download Command Line Tools, make sure that you download the version specifically for your operating system (Windows, Mac or Linux), as the executable files are not compatible between platforms.
Installation via Android Studio
Most The preferred method for most developers is to use the official IDE. When you first launch Android Studio the setup wizard starts, which prompts you to download all the necessary components. This method minimizes the risk of configuration errors, since file paths are written automatically.
During the installation process, you will be asked to select the installation type. The standard option is suitable for 95% of users; it includes Android SDK, an emulator and basic plugins. If you want to save disk space or install tools in a non-standard directory, you should select the โCustomโ mode.
In the component selection window, make sure the following items are checked:
- ๐ฆ Android SDK โ a basic set of tools and platforms.
- ๐ฑ Android Virtual Device โ the necessary software for running emulators.
- ๐ง SDK Build-Tools โ utilities for compiling and linking applications.
- ๐ฅ๏ธ SDK Platform โspecific versions of Android for which you plan to develop.
After installation is complete, the environment will offer to download additional packages through the SDK Manager. This is convenient because you can install older versions of the API for compatibility testing or new beta versions without reloading the entire toolkit. The path to the installed SDK is usually displayed in the project settings.
Download Command Line Tools
For advanced users, continuous integration (CI/CD) servers, or developers using other code editors (for example VS Code or IntelliJ IDEA without Android plugins), there is a lightweight option. It is a set of scripts that allow you to manage the installation of components directly from the terminal.
To get started, you need to download the "Command line tools only" archive from the Android SDK download page. After unpacking, you will receive a directory containing a folder cmdline-tools. An important nuance: the folder structure must be strictly defined, otherwise the package manager will not start.
It is recommended to rename the unpacked folder with the version (for example, cmdline-tools/latest) or move the contents so that the path looks like this:
android-sdk/cmdline-tools/bin
Exactly in the folder bin executable files sdkmanager and avdmanagerare located. If the structure is broken, when you try to launch you will receive an error that the path to the tools was not found. This is a common problem during manual installation, which can be easily solved by proper directory organization.
Directory structure for Linux/Mac
Unix systems often require additional execution rights for scripts. Use the chmod +x command for files in the bin folder, otherwise the system will block the launch of management utilities.
To check the functionality, enter the command sdkmanager --list. If you see a list of available packages and platform versions, the basic installation was successful. Then, through the same utility, you can install the necessary components, for example: sdkmanager "platform-tools" "platforms;android-34".
Manually setting environment variables
After the files are downloaded and unpacked, the system needs to be told where exactly they are located. Without this step, commands adb or fastboot will not be recognized in the terminal from any directory. To do this, you need to change the system environment variables.
In the operating system Windows this is done through the system properties. You need to create a new variable named ANDROID_HOME (or ANDROID_SDK_ROOT), specifying the full path to the SDK folder as the value. For example, C:\Users\Name\AppData\Local\Android\Sdk.
Then you need to add the paths to the executable files to the variable Path. It is necessary to register two main directions:
- ๐
%ANDROID_HOME%\platform-toolsโ here is the ADB debugging utility. - ๐ ๏ธ
%ANDROID_HOME%\cmdline-tools\latest\binโhere is the package manager. - ๐
%ANDROID_HOME%\tools\binโadditional tools (if used).
On macOS and Linux the process is similar, but shell profile files are edited, such as .bashrc, .zshrc or .profile. Variable export lines are added to them. After changing the configs, be sure to restart the terminal or run the command source ~/.bashrc to apply the changes.
Correctly setting the PATH variable allows you to run debugging and build tools from any folder in the terminal, which is critical for working with automation scripts.
Composition and structure of the SDK package
Understanding what exactly is inside the SDK folder helps you manage disk space more effectively and understand the logic of how the tools work. The distribution is not a monolithic file; it consists of many independent modules that can be updated individually.
Below is a table of the main directories and their purposes that you will encounter during manual installation or analysis of occupied space:
| Directory | Purpose | Required |
|---|---|---|
platform-tools |
ADB and Fastboot utilities for communicating with the device | High |
platforms |
Files of specific Android versions (API levels) | Depends on the project |
build-tools |
Compilers (dx, d8) and packers (apkbuilder) | High |
system-images |
System images for emulators (heavy files) | Optional |
extras |
USB drivers, Google Repository, test support | Average |
The largest amount of space is usually occupied by system-images old versions build-tools. If you don't plan to run emulators, you can safely skip loading system images, saving a few gigabytes. It is also worth regularly cleaning the folder from outdated versions of tools that are not used in current projects.
โ ๏ธ Attention: Do not delete files from the SDK folder manually through Explorer if you are using Android Studio. This may compromise the integrity of the package index. Always use the built-in SDK Manager to remove components.
Solving common installation problems
The download and configuration process does not always go smoothly. Developers often encounter access errors, network issues, or Java version conflicts. Knowledge of typical failure scenarios allows you to quickly return the environment to working order.
One โโof the most common mistakes is SDK location not found. It occurs when the file local.properties the project does not contain the correct path or the environment variable is not picked up by the system. Check for the presence of the file in the project root and make sure that the path to the SDK is specified without extra spaces and using forward slashes.
If the package manager gives a connection error or timeout when loading, the problem may be in the network settings or proxy. In corporate networks, it is often necessary to configure the proxy server parameters in the configuration file android.ini or run sdkmanager with proxy flags.
โ๏ธ Diagnosing problems with the SDK
It is also worth considering the version requirements JDK. Modern versions of the Android SDK require Java 11 or higher. If an old version of Java 8 is installed on the system, the tools may simply not start or work incorrectly. Make sure that the variable JAVA_HOME points to the actual JDK installation directory.
Where can I find the local.properties file?
This file is generated automatically when you open a project in Android Studio and is located in the root folder of the project. It contains local settings, including the path to the SDK, and is usually not added to version control (Git), since the paths differ from developer to developer.
Can the SDK be moved after installation?
Yes, you can. However, after moving the folder, you need to update the path in the Android Studio settings (File โ Settings โ Appearance & Behavior โ System Settings โ Android SDK) and check the environment variables in the operating system, otherwise the tools will no longer find the libraries.
How much space does the full SDK take up?
A basic installation with one version of the platform and tools takes about 2-3 GB. If you download all available Android versions, emulator images and additional drivers, the size may exceed 50-60 GB. It is recommended to install only what is needed for current development.
Is the Internet required for the SDK to work after installation?
No, compilation and launch of applications work offline. The Internet is only required for the initial download of components, updating libraries via Gradle, and downloading new versions of platforms. Local project assembly does not depend on a network connection.
What is the difference between SDK and NDK?
SDK is designed for developing applications in Java and Kotlin using standard Android APIs. NDK (Native Development Kit) is an additional set of tools for writing code in C and C++, which is used for high-performance tasks such as games or signal processing.