Gradle Guide

Cleaning Gradle, Android Build Cache, and Android Studio on Mac

Last updated: 2026-04-06

Android and Java developers accumulate significant disk usage from Gradle caches at ~/.gradle/caches, daemon files, wrapper distributions, and the Android build-cache. Android Virtual Device (AVD) images for testing on different screen sizes and API levels add several more gigabytes. Android Studio itself generates caches and logs under ~/Library that grow with every project. Together these can consume 5–12 GB or more.

Gradle caches and wrapper distributions

Gradle stores downloaded dependencies, build outputs, and plugin data in ~/.gradle/caches. Each Gradle wrapper version you have used is stored under ~/.gradle/wrapper/dists — and since different projects often use different Gradle versions, multiple copies accumulate. Daemon logs and lock files in ~/.gradle/daemon add to the total.

Android build cache and AVD images

The Android build cache at ~/.android/cache stores transformed dependencies and build intermediates. Android Virtual Device images under ~/.android/avd contain full system images for each emulator configuration — a single AVD can be 2–5 GB. If you test across multiple API levels and screen sizes, AVD images alone can consume 10+ GB.

Android Studio caches and logs

Android Studio stores its caches under ~/Library/Caches/Google/AndroidStudio* and logs under ~/Library/Logs/Google/AndroidStudio*. These grow with every project and IDE session. Old versions of Android Studio leave behind their own cache directories even after upgrading.

How CodeCleaner handles Gradle/Android cleanup

CodeCleaner detects your Android/Gradle installation, scans all of these locations, and lets you selectively clean caches, old daemon files, unused wrapper distributions, and Android Studio logs without affecting your current builds.

Manual steps (Terminal)

You can do this manually with these commands, or use CodeCleaner to automate the process with a visual interface and safety checks.

rm -rf ~/.gradle/caches
rm -rf ~/.gradle/wrapper/dists
rm -rf ~/.android/cache
rm -rf ~/Library/Caches/Google/AndroidStudio*
rm -rf ~/Library/Logs/Google/AndroidStudio*

Or use CodeCleaner

CodeCleaner automates all of this with a native macOS app. It auto-detects your installed tools, scans the relevant paths in parallel, shows per-item sizes, and lets you clean safely with one click. Free scan, no account required.