Gradle Guide

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

Last updated: 2026-04-13

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.

Gradle daemons and incremental builds

Deleting ~/.gradle/caches invalidates dependency transforms — the next sync or build will re-download artifacts. Stop Android Studio first if you remove its cache directories to avoid file locks. AVD system images are large; remove emulators for API levels you no longer test.

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. Each block shows a short label and the matching command.

Remove Gradle dependency caches

rm -rf ~/.gradle/caches

Remove Gradle wrapper distributions

rm -rf ~/.gradle/wrapper/dists

Clear Android build cache

rm -rf ~/.android/cache

Clear Android Studio caches

rm -rf ~/Library/Caches/Google/AndroidStudio*

Clear Android Studio logs

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.

Related topics

Short landing pages focused on specific searches; each links back to the same download and safety model as the homepage.

CodeCleaner on the home page

Download, feature overview, and comparison with generic cleaners live on the main landing page.

Open homepage — download