How do I delete the Gradle cache on a Mac and free Android Studio space?

Gradle keeps downloaded dependencies in ~/.gradle/caches and old Gradle versions in ~/.gradle/wrapper/dists, while Android Studio adds SDK system images, emulators and its own caches.

Shiva ChandraMaker of Clean House · · 3 min read
Short answer

To delete the Gradle cache on a Mac, stop the Gradle daemons with ./gradlew --stop, then remove ~/.gradle/caches and, if you want more space, ~/.gradle/wrapper/dists. Both are re-downloaded on the next build. Android system images and emulators are cleaned separately.

How much space is Gradle using?

Check first. This only reads sizes:

du -sh ~/.gradle/caches ~/.gradle/wrapper/dists ~/.gradle/daemon 2>/dev/null

Gradle's documentation lists what the Gradle user home (~/.gradle) holds: caches/ for downloaded dependencies and build caches, wrapper/dists/ for the Gradle versions your projects' wrappers downloaded, and daemon/ for daemon logs and registry. The same page says Gradle cleans unused entries in the background, for example version-specific caches unused for 30 days, and that most caches do not need manual management. In practice, folders still grow large on a Mac that builds many projects.

Real example: 11 GB of Gradle cache

On the developer's own Mac on 22 November 2026, deleting ~/.gradle/caches (11 GB) and the Gradle wrapper downloads (724 MB) took free space from 2.2 GB to 14 GB. The Mac then rebuilt only what the next project needed. That is the pattern: a small, safe deletion on a nearly full disk made the Mac usable again.

How do I delete ~/.gradle/caches safely?

  1. Close Android Studio, IntelliJ or any IDE with a Gradle project open.
  2. Stop running daemons from any project folder: ./gradlew --stop. (Outside a project, gradle --stop works if Gradle is installed.)
  3. Delete the caches folder:
    rm -rf ~/.gradle/caches
  4. Optional: delete old wrapper downloads:
    rm -rf ~/.gradle/wrapper/dists
  5. Open a project and build. Gradle downloads what it needs again.
These commands delete permanently. They skip the Trash and cannot be undone. Everything in them can be downloaded again, but only with an internet connection, so avoid doing this right before you go offline.

Deleting wrapper/dists removes every Gradle version the wrapper downloaded. Each project re-downloads the version it needs the first time you build it. Leave ~/.gradle/gradle.properties and any init.d scripts alone, because those hold your settings, not cache. More on the folder: Gradle caches on Mac.

Where else does Android Studio store data?

WhatWhereCall
Gradle cache~/.gradle/cachesSafe to clear
Gradle wrapper downloads~/.gradle/wrapper/distsSafe to clear
Android SDK system images~/Library/Android/sdk/system-imagesLook first
Emulators (AVDs)~/.android/avdLook first
Android Studio caches~/Library/Caches/Google/AndroidStudio*Safe to clear (IDE closed)

The SDK path above is the default on macOS; if you changed it, check Settings, Languages and Frameworks, Android SDK in Android Studio.

How do I delete Android emulators and system images?

Android's documentation says an AVD is created in ~/.android/avd/ by default, and each needs a system image, a download of Android for that API level. Both take real space: an AVD holds its own disk image, and each system image is a separate download.

List what you have, then delete by name:

du -sh ~/.android/avd/* ~/Library/Android/sdk/system-images/* 2>/dev/null
avdmanager list avd
avdmanager delete avd -n Pixel_8_API_34

avdmanager is in the SDK's cmdline-tools folder; if the command is not found, use Android Studio's Device Manager, open the menu next to a device and choose Delete. Deleting an AVD removes its stored data for good. Then remove system images you no longer use with the SDK Manager or:

sdkmanager --list_installed
sdkmanager --uninstall "system-images;android-34;google_apis;arm64-v8a"

Use the exact package name from the first command. Unlike caches, an emulator may hold test data you set up by hand, so Android AVDs is a "Look first" folder. Note the emulator should be closed first.

What about Android Studio's own caches?

Android Studio keeps indexes and caches in a version-named folder under ~/Library/Caches/Google/ (for example AndroidStudio2024.2). Close the IDE and delete old versions' folders, or use File, Invalidate Caches inside the IDE, which clears the current one and restarts. Expect a re-index afterward. Folders for Studio versions you no longer have installed are the safest to remove.

How does Clean House handle Gradle and Android storage?

Clean House recognizes Gradle caches and Android emulators as developer data. They show in the Dev Desk room with a "Why?" card saying where they came from and what happens if they go (a re-download, in the Gradle case), and a call of Safe to clear, Look first or Keep. Cleaning moves items to the Trash after a re-check, with Recently Cleared to put them back. It avoids items an app is using, so quit your IDE first.

Related: Xcode storage, Docker disk space and freeing up space on a Mac.

Questions

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

Yes, as long as you can download again. Gradle rebuilds the folder from your project files and its repositories. Your first build afterward is slower and needs internet access. Stop the Gradle daemons first.

How big is ~/.gradle/caches?

It depends on how many projects and Gradle versions you have used. On the developer's own Mac it was 11 GB, with another 724 MB of Gradle wrapper downloads.

Does Gradle clean its own cache?

Partly. Gradle's docs say it removes unused cache entries and old distributions in the background, after periods such as 7 or 30 days. It does not shrink a cache full of things you still use, so it can stay large.

Why is Android Studio using so much storage?

Mostly the Android SDK (especially system images), emulator devices in ~/.android/avd, Gradle caches and Android Studio's own caches. Emulator images and AVDs are often the largest.

Can I delete an Android emulator?

Yes. Delete it in Android Studio's Device Manager or with avdmanager. The emulator's data is removed with it, and you can create a new one later.

Sources

  1. Gradle docs: Gradle User Home directory
  2. Android Developers: avdmanager
  3. Android Developers: Create and manage virtual devices