# How to Clean Android Studio, Gradle Caches, AVDs & SDKs on Mac

> Android development on macOS piles up 15–70 GB across ~/.gradle/caches (artifact transforms, versioned caches, modules-2), wrapper distributions, Android Virtual Devices (~/.android/avd), orphaned SDK system images, multi-gigabyte NDK toolchains, and leftover ~/Library/Caches/Google/AndroidStudio* folders from previous IDE releases. Deleting old Gradle versions, Quick Boot snapshots, unused system images, and uninstalled Studio data is completely safe.

- **Canonical URL**: https://cruft.app/guides/clean-android-studio-gradle-caches-mac
- **Category**: Android Studio
- **Typical Reclaimable Space**: 15–70 GB
- **Last Updated**: 2026-12-04

## Quick Facts

- **Typical reclaimable space**: 15–70 GB
- **Safe auto-rebuilding caches**: ~/.gradle/caches/transforms-*, build-cache-*, daemon logs, AVD snapshots
- **Hidden multi-GB offenders**: Unused SDK system-images, old NDK versions (1–3 GB each), old AndroidStudio* data
- **Review before deleting**: AVD userdata-qemu.img (emulator app state), ~/.m2/repository, user JDKs

## Exact macOS Paths & Safety Reference

| Location | macOS Path | Typical Size | Safety | Rebuild / Effect |
| --- | --- | --- | --- | --- |
| Gradle Caches & Daemon Logs | `~/.gradle/{caches,daemon,kotlin-profile}` | 5–25 GB | Safe | Transforms, build caches, and old versioned caches rebuild automatically; modules-2 re-downloads dependencies. |
| Gradle Wrapper Distributions & JDKs | `~/.gradle/{wrapper/dists,jdks}` | 1–8 GB | Re-download | Older Gradle wrapper versions re-download if an old repo needs them. |
| Emulator Quick Boot Snapshots | `~/.android/avd/*.avd/snapshots` | 1–10 GB | Safe | Emulator simply cold-boots on next launch; installed apps stay intact. |
| Android Virtual Devices (AVDs) | `~/.android/avd/*.avd` | 4–30 GB | Review | Removes the entire emulator and its installed apps/user data. |
| SDK System Images | `~/Library/Android/sdk/system-images` | 3–25 GB | Re-download | Images not referenced by any AVD can be removed and re-downloaded from SDK Manager. |
| Android NDK & CMake | `~/Library/Android/sdk/{ndk,ndk-bundle,cmake}` | 2–12 GB | Re-download | 1–3 GB per NDK version; Gradle auto-downloads pinned ndkVersion on build. |
| Old Android Studio Releases | `~/Library/{Caches,Logs,Application Support}/Google/AndroidStudio*` | 1–8 GB | Re-download | Every major Studio upgrade creates new folders and abandons the old version's caches & plugins. |

## 1. Trim ~/.gradle caches and old Gradle wrapper distributions

Every time a project upgrades Gradle, Gradle creates a brand-new versioned subfolder under ~/.gradle/caches/<version> and keeps the old wrapper zip/distribution in ~/.gradle/wrapper/dists. Meanwhile, transforms-* (dexed and unpacked dependencies) and daemon logs silently swell to 10+ GB.

Deleting old Gradle version folders, transforms-*, build-cache-*, and daemon logs is completely safe — keep modules-2 if you're on slow Wi-Fi since clearing it re-downloads JAR/AAR dependencies on your next build.

**Inspect ~/.gradle breakdown by size**

```sh
du -sh ~/.gradle/caches/* ~/.gradle/wrapper/dists/* ~/.gradle/daemon/* 2>/dev/null | sort -hr
```

## 2. Remove unused SDK system images and Quick Boot snapshots

Deleting an emulator in Device Manager does NOT remove the multi-gigabyte system image it used inside ~/Library/Android/sdk/system-images. Checking each AVD's config.ini (image.sysdir.1) reveals which system images are genuinely orphaned.

For AVDs you want to keep, deleting only the snapshots subfolder frees gigabytes immediately while preserving all installed apps — the emulator just performs a cold boot next time.

**See which system images your AVDs actually reference**

```sh
grep -h "image.sysdir.1" ~/.android/avd/*.avd/config.ini 2>/dev/null
du -sh ~/Library/Android/sdk/system-images/*/*/* 2>/dev/null | sort -hr
```

## 3. Clean abandoned Android Studio version directories

Android Studio namespaces its data by release (for example AndroidStudio2024.3, AndroidStudio2025.1) across ~/Library/Caches/Google, ~/Library/Logs/Google, and ~/Library/Application Support/Google. When you upgrade Studio, older version folders remain on disk indefinitely.

Never delete Application Support/Google/AndroidStudio* for your currently installed version (that holds your settings and plugins), but folders belonging to versions you no longer have installed are pure leftovers.

## How Cruft Automates This Safely

- Cross-references every AVD's config.ini against ~/Library/Android/sdk/system-images to tag genuinely Unused images while protecting active ones.
- Inspects installed Android Studio bundles (product-info.json) so your live version's Settings & Plugins are never offered, while abandoned Studio releases are flagged “Not installed”.
- Locks running Android emulators via their QEMU lockfiles and separates Safe Quick Boot snapshots from Review AVDs.

Download Cruft free to scan (https://updates.cruft.app/Cruft.dmg) or buy a lifetime 3-Mac license for €15 once (https://license.cruft.app/buy).

## Frequently Asked Questions

### Is it safe to delete ~/.gradle/caches?

Yes, as long as no Gradle build is currently running (run ./gradlew --stop first). Deleting transforms-*, build-cache-*, and older Gradle version caches is fast and safe; deleting modules-2 is also safe but causes Gradle to re-download library dependencies on the next build.

### Why does Android Studio leave gigabytes behind after upgrading?

Each major Android Studio release writes its caches, logs, and settings into a versioned directory under ~/Library/Caches/Google, ~/Library/Logs/Google, and ~/Library/Application Support/Google, and upgrades do not remove the previous version's folders.

### What happens if I delete an Android emulator's snapshots folder?

Deleting ~/.android/avd/<name>.avd/snapshots removes Quick Boot saved RAM state. Your emulator and its installed apps remain intact; it simply cold-boots the next time you launch it.
