Where apps hide your files
The SDK and the emulators live in two different places, one in Library and one in a hidden folder. Here are both paths, what fills them, and how to shrink or move them safely.
On a standard install, Android Studio puts the SDK here:
~/Library/Android/sdk
Virtual devices (emulators) live somewhere else, in a hidden folder:
~/.android/avd/
Each emulator is a folder named <name>.avd (for example Pixel_8_API_36.avd) with a matching <name>.ini file beside it. The SDK and the emulators are separate trees, so a full disk usually means checking both.
To open either one, press ⇧⌘G in Finder (Go > Go to Folder) and paste the path, or run open ~/Library/Android/sdk in Terminal. ~/.android is hidden, so it will not appear when you browse your home folder until you press ⇧⌘. in Finder.
The default is only a default. The setup wizard lets you choose another folder, and teams often point everything at a shared location. In Android Studio, open Tools > SDK Manager: the Android SDK Location field at the top is the answer for that install. The same page is in Android Studio > Settings > Languages & Frameworks > Android SDK.
Outside the IDE, the SDK tools read the ANDROID_HOME environment variable. Google's documentation sets it in a shell profile; a trimmed version that adds only platform-tools to your PATH looks like this:
export ANDROID_HOME=~/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
ANDROID_SDK_ROOT is the older name for the same thing. Google marks it deprecated and says Android Studio and the Android Gradle plugin check that the old and new variables agree if you still set it. To see what your shell has, run echo $ANDROID_HOME. An empty result means the variable is not set, not that the SDK is missing.
A project can also pin the path in its own local.properties file, in the line sdk.dir=. That file is generated per project and is why two projects can show different SDK paths.
| Folder | Holds |
|---|---|
platforms/ | One android-NN folder per API level you compile against |
build-tools/ | Versioned build tools such as aapt2 and zipalign |
platform-tools/ | adb and fastboot |
emulator/ | The emulator program itself |
system-images/ | The Android OS images emulators boot from, grouped by API level and variant |
ndk/ | One folder per installed NDK version, only if you installed it |
cmake/ | CMake for native builds, only if you installed it |
cmdline-tools/ | sdkmanager and avdmanager (older installs keep them in tools/bin) |
licenses/ | Records of the licences you accepted |
On the Apple silicon Mac used to check this guide, the SDK came to about 10 GB: ndk/ alone was 5.4 GB (two NDK versions), system-images/ 2.8 GB and emulator/ 1.2 GB. Old NDKs and system images for API levels you no longer test are the usual dead weight.
Inside a device folder such as ~/.android/avd/Pixel_8_API_36.avd/ you will find disk images such as userdata-qemu.img, sdcard.img and cache.img (plus .qcow2 overlays of them), config.ini (the device definition) and a snapshots/ folder for quick boot. The userdata image is the phone's own storage: apps you installed on it, files you pushed to it, and so on. The single test emulator on the Mac used for this guide took 6.8 GB.
The .ini file next to the folder holds the lines path=, path.rel= and target=: the device folder's location and its API target. It is how the tools find the device, which matters when you move things.
Other files in ~/.android are small but personal. adbkey and adbkey.pub are the keys adb uses to pair your Mac with phones, and debug.keystore is the default debug signing key for apps you build. Never share the private ones, and keep them if you want your existing phones to keep trusting this Mac.
Use Android Studio rather than deleting folders by hand:
.avd folder and its .ini together.If you do remove an old system image or NDK folder in Finder, quit Android Studio and any running emulator first, and move it to the Trash rather than using rm, so you can put it back. Leave licenses/ alone unless you are happy to accept the licences again, and never delete a .avd folder without its .ini (or the other way round), because the tools will then see a broken device.
To move the SDK, copy the folder to the new location, then set the new path in the SDK Manager's Android SDK Location field and update ANDROID_HOME in your shell profile. Remove the old copy only after a project builds against the new one.
For emulators, set the ANDROID_AVD_HOME environment variable to the new folder. Google documents the chain of defaults: ANDROID_AVD_HOME defaults to $ANDROID_EMULATOR_HOME/avd, ANDROID_EMULATOR_HOME defaults to $ANDROID_USER_HOME, and that defaults to ~/.android. Changing ANDROID_USER_HOME moves the role of the whole .android folder, keys included, so most people change only ANDROID_AVD_HOME. Apps opened from the Dock do not read your shell profile, so Android Studio has to be started in a way that passes the variable along, such as running its launcher from a Terminal where the variable is exported.
To back up a device or carry it to a new Mac, copy both the .avd folder and its .ini, then open the .ini in a text editor and correct the path= line to the new absolute path. Recreating the emulator from a system image is often faster than copying several gigabytes.
Both folders sit where Spotlight does not look: ~/Library is left out of its results and ~/.android is a hidden dot-folder. On the Mac used for this guide, a Spotlight query for userdata-qemu returned nothing although the file was there.
Everywhere indexes file names inside ~/Library and hidden folders too, so typing userdata-qemu lists every emulator's storage image with its location, and typing android-34 shows that API level's platform and system image folders side by side. Press ⌘↵ on a result to reveal it in Finder. It matches names only, so it will not tell you which images are largest; for that, run du -sh ~/Library/Android/sdk/* ~/.android/avd/* in Terminal, which only reads sizes.
By default it is ~/Library/Android/sdk. Confirm it in Android Studio under Tools > SDK Manager, where the Android SDK Location field shows the path in use.
In ~/.android/avd/, one <name>.avd folder per device plus a <name>.ini file beside it. The folder is hidden, so use Go to Folder or press Shift-Command-period in Finder.
Yes, but remove them in the SDK Manager (clear the checkbox, then Apply) so Android Studio stays consistent. Any emulator using a removed image needs that image again before it boots.
Set the ANDROID_AVD_HOME environment variable to the folder you want, then start Android Studio and the emulator with that variable in place. Copy existing .avd folders with their .ini files and fix the path line in each .ini.
Everywhere keeps track of every file on your Mac — including the folders Spotlight hides and drives you have unplugged. Free for a day, then $19 once.
Version 2.20.3 · macOS 13+ · 4.7 MB · notarised