Separate build cache from installed SDKs
| Data | Examples | Cost of removal |
|---|---|---|
| Local Gradle build cache | build-cache-1, transforms-*, jars-*, versioned 8.x folders | The next build recreates them locally |
| Downloaded Gradle dependencies | modules-2, metadata-* | Needs network. Offline or private-repo builds fail until they are fetched again |
| Rebuildable IDE cache | Android Studio indexes | Re-indexing on the next open |
| Versioned SDK components | platforms, build-tools, NDK, system-images | Projects or emulators may still require that exact version |
| AVD device data | Apps, settings and files in an emulator | User/test state can be lost |
Measure the usual locations
du -sh "$HOME/Library/Android/sdk" 2>/dev/null
du -sh "$HOME/.gradle/caches" "$HOME/.gradle/wrapper/dists" 2>/dev/null
du -sh "$HOME/.android/avd" 2>/dev/nullUse the SDK location shown in Android Studio → Tools → SDK Manager if yours differs. Check ANDROID_HOME and a project local.properties file rather than assuming the default path. The combined ~/.gradle/caches size mixes local build cache with downloaded dependencies in modules-2. Do not treat that whole folder as safe to delete.
Remove one confirmed-unused SDK package
Check compileSdk, buildToolsVersion and ndkVersion in the projects you still build. In Tools → SDK Manager, show package details, deselect a version you no longer need, then Apply. Keep system images used by your AVDs and SDK components pinned by older projects. Newest does not mean sufficient for every project.
For command-line inspection, use the sdkmanager shipped with your SDK and consult its local help. This lists packages; it does not delete them:
sdkmanager --list_installedLet Gradle manage routine cache retention
Gradle already manages retention of many caches. Inspect the layout before sweeping .gradle. Stop running builds and daemons with the wrapper in each active project when doing a manual cleanup:
./gradlew --stopRemove only a confirmed-old wrapper distribution or rebuildable cache entry after reviewing it. Leave gradle.properties, credentials, signing keys and custom init scripts alone. Next builds can need network access to download the wrapper and dependencies; keep required versions when offline.
An emulator image is different from a device
An SDK system image supplies the operating system; an AVD directory contains a configured device and its state. Use Android Studio Device Manager for an intentional device deletion. Clearing an emulator snapshot removes saved state and is not equivalent to removing all AVDs.
Review older versions in DevCleaner
The Android scanner shows local Gradle caches separately from downloaded dependencies. build-cache-1, transforms-*, jars-*, and versioned folders such as 8.x (including generated-gradle-jars and kotlin-dsl) stay Safe and are part of Quick Clean. ~/.gradle/caches/modules-2 and metadata-* are Warning, unchecked, and not part of Quick Clean. The next build needs network access and is slower. Offline or private-repo builds fail until those dependencies are fetched again. With By risk, that Warning cleanup goes to the Trash. Old SDK/build-tools/NDK/system-image candidates and Gradle wrapper distributions stay separate. Keep-newest logic is a starting point for review, not proof that an older project no longer needs a version. See keep-current policies and category evidence.
FAQ
- Can I delete the entire Android SDK?
- That removes platforms and tools needed by projects. Use SDK Manager to remove specific versions after checking project requirements.
- Is an old NDK safe to remove?
- Only if no active project pins it. Check ndkVersion and your build configuration before removing the package.
References and scope
Reviewed against DevCleaner 1.14.5 and the references below on October 4, 2026. Locations can change with tool versions and custom settings. The examples are inspection steps and deliberate cleanup actions, not a measured claim about how much space your Mac will recover.
- Android SDK Manager and unused IDE directories
- sdkmanager command reference
- Gradle cache layout and retention
Review the space before cleaning
DevCleaner separates built-in Safe caches from Warning and Danger items. Safe Quick Clean is free; deep cleanup requires Pro on new Free installations. See Free and Pro features.
Download DevCleaner ↓