When starting the development environment for the first time to create mobile applications, users are often faced with the question of the location of app files. Android Studio by default, it takes up a significant amount of disk space, and understanding the structure of its placement is critical for proper file management. The standard installation procedure offers automatic directory selection, but experienced developers often need to manually configure paths.

Many beginners do not suspect that the app itself and its additional components, such as Android SDK and emulator system images, can be located in completely different places in the file system. This division often leads to confusion when trying to free up disk space or move tools to another partition. In this article we will analyze in detail the standard paths, methods for changing them and the nuances of working with virtual devices.

Knowing the exact location of executable files and libraries is necessary not only for disk cleanup, but also for the correct operation of plugins, integration with version control systems and setting environment variables. By default, all components are installed in a hidden user folder, which often makes them difficult to find without enabling display of hidden files. Let's take a look at exactly where to look for the necessary data depending on your operation system.

Standard installation paths in Windows

In the Windows operating system, the data storage structure is strictly regulated, and Android Studio follows these rules. The main app is usually located in the system's app Files directory, which provides a standard level of access for executable files. However, this applies only to the IDE interface itself, but not to all related tools.

A more important issue is the location Android SDKwhich is hidden from the user's view by default. It is located in the current user's profile, in a folder named AppData. The complete path looks like C:\Users\UserName\AppData\Local\Android\Sdk. This is where platforms, build tools and system images are stored, which take up the most space.

If you are planning on reinstalling the system or moving a project, you need to know the exact location of these files. Ignoring this fact may lead to loss of settings and the need to re-download gigabytes of data. Below is a table with the main directories for quick navigation.

Component Typical location path Space occupied
Android Studio IDE C:\app Files\Android\Android Studio ~1-2 GB
Android SDK C:\Users\..\AppData\Local\Android\Sdk 10-50 GB+
Gradle Cache C:\Users\..\.gradle\caches 5-20 GB
AVD (Emulators) C:\Users\..\.android\avd 10-30 GB

It is worth noting that the paths may vary slightly depending on the version of Windows or the user's choice during manual installation. Always check the desktop shortcut properties to see where the application is running from. This will help you quickly navigate the file structure.

Location of files on macOS and Linux

Users of operating systems of the Unix family, which include macOS and distributions Linux, face a different logic for organizing the file system. There are no drive letters here, and all applications and user data are distributed in strictly defined directories within the home directory. This provides greater security, but requires an understanding of the path structure.

On macOS, the application Android Studio is usually presented as a single container file .app, which is located in the folder Applications. However, as in Windows, all heavy components, such as the SDK and Gradle cache, are placed in hidden folders in the user's home directory. To access them, you often need to use a terminal or enable the display of hidden files via a key combination Command + Shift +..

In Linux distributions the situation is similar, but the paths may vary depending on the installation method: through a package manager (Snap, Flatpak, Apt) or manually. With a manual installation, the user chooses the target directory, often placing files in /opt or their own home folder. /home/user.

To navigate hidden folders in macOS, you can use the Go to Folder feature in the Finder. On Linux, the most effective way is to use a file manager with support for hidden files or the command line. This allows you to quickly find configuration files and the cache.

โš ๏ธ Attention: The structure of hidden folders (starting with a dot) may change with operating system updates. If you do not see the folder .android or .gradle, make sure that the display of hidden items is turned on.

How to change the installation path when you first start

The most reliable way to determine where is installed Android Studio and its components - control this process initially. When you first launch the installer (file .exe for Windows or .dmg for macOS), the system will prompt you to select components to install. At this stage, you can change the standard paths.

In the component settings window (Customize), you need to pay attention to the checkboxes opposite items Android Virtual Device and Android SDK. Next to them there is often a browse button or a field for entering a path. By changing it at this stage, you will immediately direct heavy files to a disk with a large amount of free space, for example, to the D: partition or an external SSD.

If you missed this point and have already installed the development environment, do not despair. You can change the location of the SDK through the settings of the IDE itself. To do this, open the menu File (or Android Studio on macOS), select Settings (or Preferences), then go to the Appearance & Behavior โ†’ System Settings โ†’ Android SDKsection. In the field Android SDK Location you can specify a new path.

โ˜‘๏ธ Check before installation

Done: 0 / 4

It is important to understand that simply moving folders through Explorer without changing the settings will lead to an error launching projects. The development environment will no longer find compilers and libraries. Therefore, changing the path must be done either through the installer or through the internal settings of the app.

Transferring Android SDK and emulator

Over time, the SDK folder grows to impressive sizes, occupying tens of gigabytes. There is a need to transfer it to another disk. This can be done without a complete reinstallation, but care is required. First close Android Studio completely, including background emulator processes.

Then copy the contents of the SDK folder (default ..\AppData\Local\Android\Sdk) to a new location, for example, D:\Android\Sdk. After copying, you need to launch the IDE, go to the SDK settings (as described in the previous section) and specify the new path. The app will automatically detect the files and update the configuration.

The emulator requires special attention (Android Virtual Device). Its files are stored in the folder .android in the user profile. To transfer the emulator, it is not enough to simply move the files; you need to change the environment variable ANDROID_AVD_HOME. This is the system where you can now look for images of virtual devices.

To set a variable in Windows, use the search for "Changing system environment variables", create a new variable with the name ANDROID_AVD_HOME and specify the path to the new folder. On macOS or Linux, add the line export ANDROID_AVD_HOME=path/to/folder to the shell configuration file (for example, .bashrc or .zshrc).

Why does the emulator take up so much space?

The emulator is a full-fledged virtual machine. It contains an operating system image, user data, application cache and snapshots. Each created virtual phone adds another 10-15 GB of data.

Setting environment variables

For the correct operation of the command line and build tools, such as As adb and fastboot, it is necessary for the system to know where they are located. These executable files are located in the folder platform-tools inside the SDK directory. Adding the path to them to the system variables will eliminate the need to write the full path to the command each time.

In Windows, this is done. through the system properties menu. You need to find the variable Path in the list of system variables and add the value %ANDROID_HOME%\platform-tools there (if the variable ANDROID_HOME has already been created) or the full path to the folder. This will allow you to run USB debugging from any terminal window.

On macOS and Linux, similar actions. are performed by editing the profile file. After adding the paths, you must restart the terminal or run the command source ~/.zshrc (or the corresponding shell file) for the changes to take effect. You can check the success by typing the command adb version in the terminal.

Incorrect setting of variables is a common cause of errors when building a project or connecting a real device. adb is not recognized, check this parameter first. Make sure that there are no typos in the path and that it leads to the current version of the tools.

Clearing the cache and freeing up space

During the process Android Studio accumulates a huge number of temporary files. Gradle cache, old platform versions and logs can take up space comparable to the size of the SDK itself. Regularly cleaning this data helps speed up the IDE and free up disk space.

There is a built-in cleaning function inside the studio itself. In the menu File select Invalidate Caches / Restart. This is a safe way to remove internal indexing caches and temporary files without the risk of damaging your projects. After the reboot, the app will re-index the files, which may take some time.

It is also worth manually checking the folder .gradle in the user profile. This is where all dependency libraries that have ever been downloaded are stored. You can safely delete old versions if you are sure that they are not used in active projects, or use the command to clear the Gradle cache: ./gradlew clean in the project terminal.

๐Ÿ’ก

Use the built-in disk analyzer (Storage Manager) in Android Studio settings to visually assess which components are taking up the most space and remove unnecessary API versions.

Don't forget about emulators. If you have created several virtual devices for tests that are no longer needed, delete them through the menu Device Manager. Each such device is a separate disk image file that can weigh 10-20 GB. Removing them will instantly return gigabytes of free space to you.

Frequently asked questions

Is it possible to install Android Studio on an external USB drive?

Technically this is possible, but it is highly not recommended for permanent work. The read/write speed of a regular USB drive is significantly lower than that of an internal SSD, which will lead to very long project assembly times and interface lags. Use an external drive only to store SDK backups or archives.

What to do if the path to the SDK contains Cyrillic?

This is a common cause of compilation errors. Many build tools (especially older versions of NDK or CMake) do not handle paths with Russian letters or spaces correctly. It is recommended to reinstall the SDK in a folder with a path containing only Latin letters, for example, C:\Android\Sdk.

Where is the local.properties file located?

This file is created in the root of each of your projects and contains local settings, including the path to the SDK (sdk.dir=..). It doesn't go into Git version control by default. If you transfer the project to another computer, this file will need to be updated or created again.

How to completely remove Android Studio from your computer?

Simply uninstalling the app through "Add or Remove apps" is not enough. You need to manually delete the folders .android, .gradle, AndroidStudio (in AppData) and the SDK directory itself. Only after this the removal will be complete.

๐Ÿ’ก

Proper management of paths to the SDK and emulator is the key to stable operation of Android Studio and saving space on the system disk.