Android Studio is a small download and a large habit. Every time the SDK Manager offers an update, it installs the new version next to the old one and never removes the old one. A year of updates leaves five NDKs of 1 to 4 GB each, a dozen build-tools, platforms for every API level you once targeted, and an emulator image for each phone you tested. Add the Gradle cache and a few abandoned virtual devices, and 60 GB is normal.
Start by measuring. The commands work on both systems, the paths are the ones listed in each section:
# Mac
du -sh ~/Library/Android/sdk ~/.android ~/.gradle ~/Library/Application\ Support/Google 2>/dev/null
# Ubuntu
du -sh ~/Android/Sdk ~/.android ~/.gradle ~/.config/Google ~/.cache/Google 2>/dev/null
If you moved the SDK, its place is in ANDROID_HOME (or ANDROID_SDK_ROOT), and in Settings > Languages & Frameworks > Android SDK. Quit Android Studio, running emulators and Gradle builds before you delete anything below.
The SDK folder: NDK, build-tools, platforms, CMake
The SDK lives in ~/Library/Android/sdk on a Mac and ~/Android/Sdk on Ubuntu. Inside, these folders collect versions:
ndk/<version>: one folder per NDK, 1 to 4 GB each. Android Studio installs the NDK a project asks for, so several projects mean several NDKs.build-tools/<version>: about 100 to 200 MB each.platforms/android-<N>: one per API level, a few hundred MB each.cmake/<version>: a few hundred MB each.
The folders you must not touch are platform-tools, emulator and licenses.
Remove versions through the SDK Manager’s command line, so its records stay correct:
~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --list_installed
~/Library/Android/sdk/cmdline-tools/latest/bin/sdkmanager --uninstall "ndk;26.1.10909125" "build-tools;33.0.2" "platforms;android-33"
On Ubuntu use ~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager. The same can be done in Settings > Languages & Frameworks > Android SDK, with Show Package Details ticked on the SDK Platforms and SDK Tools tabs.
The rule to follow: keep the newest version of each kind, and keep every version one of your projects pins. A project pins a version with ndkVersion, buildToolsVersion or compileSdk in its build.gradle or build.gradle.kts, or ndk.dir in local.properties. Search for them before you delete:
grep -rn --include=build.gradle --include=build.gradle.kts --include=local.properties \
-E "ndkVersion|buildToolsVersion|compileSdk|ndk.dir" ~/Developer 2>/dev/null
Replace ~/Developer with where your projects live. If you remove a version a project needs, Gradle downloads it again the next time you build, so the cost of a mistake is a download.
Emulator system images
Each system image sits in system-images/<android-N>/<tag>/<abi> inside the SDK, and is often 1 to 8 GB. Deleting a virtual device (AVD) does not delete its image, so images pile up long after the devices are gone.
sdkmanager --list_installed | grep system-images
sdkmanager --uninstall "system-images;android-34;google_apis;arm64-v8a"
Before you delete one, check which images your devices use. Each device has a config.ini that names its image in image.sysdir.1:
grep -H image.sysdir ~/.android/avd/*.avd/config.ini
An image no device names is safe to remove; the SDK Manager downloads it again when you need it.
Virtual devices and their snapshots
Virtual devices live in ~/.android/avd, one <name>.avd folder each (ANDROID_AVD_HOME can move them). The folder holds the device’s disk image, which grows as you install apps. The snapshots folder inside it holds the quick-boot snapshots, often several GB per device, and the next start of the device is only slower without them (a cold boot); its apps and data stay.
avdmanager list avd
avdmanager delete avd -n Pixel_6_API_34
du -sh ~/.android/avd/*.avd/snapshots
rm -r ~/.android/avd/Pixel_6_API_34.avd/snapshots
Quit the emulator first. avdmanager delete avd removes the device completely, including its data, so use it only for devices you will not boot again.
The Gradle cache and wrapper downloads
Gradle keeps everything it downloads in ~/.gradle:
~/.gradle/caches: dependencies and build caches, easily 5 to 20 GB.~/.gradle/wrapper/dists: one full Gradle distribution (100 to 200 MB) for each version a project’s wrapper ever asked for.
Stop the daemons before deleting, or they recreate files while you work:
./gradlew --stop # or: gradle --stop
du -sh ~/.gradle/caches ~/.gradle/wrapper/dists/*
rm -r ~/.gradle/caches
The next build downloads the dependencies it needs, so the first build after a cleanup is slow and needs network. For the wrapper, delete only the version folders of Gradle releases no project uses any more. If you set GRADLE_USER_HOME, the folder is there instead of ~/.gradle.
Old Android Studio versions
Every Android Studio release creates its own settings, caches and logs, named after the version, for example AndroidStudio2025.1. An upgrade does not remove the old ones, and the caches alone are often a few GB.
- Mac:
~/Library/Application Support/Google/AndroidStudio*,~/Library/Caches/Google/AndroidStudio*and~/Library/Logs/Google/AndroidStudio*. - Ubuntu:
~/.config/Google/AndroidStudio*,~/.local/share/Google/AndroidStudio*and~/.cache/Google/AndroidStudio*. A Flatpak or Snap build keeps them in~/.var/app/...or~/snap/....
Keep the folders of the version you run and delete older ones once you have confirmed the newer one has your settings. JetBrains IDEs (IntelliJIdea2025.1, GoLand2025.3, PyCharm...) leave the same trail in their own folders.
How CleanMate does it
CleanMate puts these items in the developer junk of Smart Scan, with their sizes, on a Mac (all macOS features) and on Ubuntu (all Ubuntu features). Nothing is removed until you confirm, and the items below are never ticked for you.
- Old Android SDK components: one row per old NDK, build-tools, SDK platform and CMake version, such as “NDK 26.1.10909125”. It always keeps the newest of each kind and every version a project pins with
ndkVersion,buildToolsVersion,compileSdkorndk.dir. It finds those by readingbuild.gradle,build.gradle.ktsandlocal.propertiesof the projects in your home folder; it never runs Gradle, and a value it cannot read pins nothing, so a project kept elsewhere may still need a listed version.platform-tools,emulator, system images and licenses are never touched. It is locked while Android Studio, a Gradle build or the emulator runs. - Android system images without a device: each image no virtual device names in its
config.ini, such as “Android 34 · google_apis · arm64-v8a”. If a device cannot be read (a damaged settings file, a drive that is not mounted), nothing is listed. It is locked while Android Studio, the emulator,sdkmanageroravdmanagerruns. - Android emulator snapshots: the
snapshotsfolder of each device, ticked one by one when expanded. The device, its disk and its settings are never touched, and the item is skipped while an emulator runs. - Gradle in the package caches: the dependency caches, and downloaded wrapper versions as a separate unticked item.
- Old JetBrains IDE and Android Studio versions: the settings, caches and logs folders of versions older than the newest of the same product, never the newest. Each version can be ticked on its own, and it is skipped while the IDE runs. They go to the Trash, so Undo puts them back.
SDK components and system images are deleted rather than moved to the Trash, because the SDK Manager downloads them again. The desktop app on Ubuntu lists each version and each image on its own row too.
If your disk is still full after this, the next suspects are Xcode (Xcode using too much space), containers (Docker using too much disk space) and the rest of the developer caches (Free up disk space on a Mac as a developer or on Ubuntu). To compare what CleanMate does with other cleaners, see the comparison. JetBrains IDEs and VS Code are in their own guide. Maven and the Gradle cache of other Java and Kotlin projects are covered in Rust, Go and Java package caches, and Unity’s Android build support in Unity using too much disk space.
For mobile projects, see Flutter, React Native and the iOS Simulator filling your Mac.
FAQ
Is it safe to delete old NDK versions? Yes, if no project pins them. Gradle or the SDK Manager downloads a version again when a build asks for it, so the cost of a mistake is a download of 1 to 4 GB.
Why is the Android Studio folder so large when I just installed it? The application itself is under 2 GB. The space is in the SDK folder, the emulator images, ~/.android and ~/.gradle, which Android Studio creates outside the application.
Can I delete ~/.gradle/caches safely? Yes. It is a cache; the next build downloads what it needs. Run gradle --stop first and expect one slow build.
Does deleting a virtual device free its system image? No. The image is a separate SDK package. Remove it with sdkmanager --uninstall or let a cleaner list the images no device uses.

