SiftMac
Is it safe to delete? · Package caches · Updated 21 November 2026

Is it safe to delete Gradle’s caches in ~/.gradle?

By Mohit Nippanikar, who makes SiftMac

The short answer
On this page
  1. What’s in ~/.gradle
  2. Where it is
  3. How big it gets, and what Gradle prunes itself
  4. How to clear it safely
  5. What the next build does
  6. Questions

1. What’s in ~/.gradle

~/.gradle is the Gradle User Home, shared by every Gradle and Android project you build, from Terminal or from Android Studio and IntelliJ IDEA. Gradle’s docs list what lives there:

2. Where it is

~/.gradle

GRADLE_USER_HOME moves it. Each project also has its own .gradle folder and build output, covered further down.

3. How big it gets, and what Gradle prunes itself

du -sh ~/.gradle/* 2>/dev/null | sort -h

Gradle cleans its user home on its own, by default at most once every 24 hours, in the background when a daemon stops:

So a large ~/.gradle usually means many projects, Gradle versions or JDKs in recent use, or a cleanup that someone switched off in an init script.

4. How to clear it safely

  1. Quit Android Studio or IntelliJ IDEA, and let running builds finish.
  2. Stop the daemons with ./gradlew --stop in a project, or gradle --stop. Each stops only daemons of its own Gradle version; others shut themselves down after 3 idle hours, and gradle --status lists those of the current version.
  3. Clear the caches, then look at which distributions you have.
./gradlew --stop
rm -rf ~/.gradle/caches/*
ls ~/.gradle/wrapper/dists

Delete a version folder in wrapper/dists only if no project still uses that Gradle version; otherwise that project’s next ./gradlew downloads it again. Leave gradle.properties, which can hold signing settings and repository credentials, and init.d alone.

In each project

A project’s build folder is its output: the clean task deletes the build directory, and the next build makes it again. The project’s .gradle folder is Gradle’s per-project cache, with build state for incremental builds and the configuration cache; it can go too, with Gradle stopped.

./gradlew clean

5. What the next build does

Questions

Is it safe to delete the whole ~/.gradle folder?

Mostly, but it also deletes gradle.properties and init.d, which are your settings rather than cache. Clear caches, wrapper/dists and jdks instead.

Do I need to stop the Gradle daemon first?

Yes. Gradle shares its caches between running processes using lock files, so stop the daemons before removing files from under them. --stop takes a moment.

Can I make Gradle clean up sooner?

Yes, with an init script in ~/.gradle/init.d that shortens the retention periods. Gradle only reads cache cleanup settings from init scripts.

Does clearing ~/.gradle remove my Android emulators?

No. Emulators and the SDK live in ~/.android and ~/Library/Android/sdk; see Android emulators and the Android SDK.

How SiftMac handles it. Its Developer files category lists each project’s build and .gradle folders, next to a build.gradle or settings.gradle file, in projects you haven’t changed for 1, 3 or 6 months; none is ticked until you tick it. SiftMac doesn’t clear ~/.gradle itself: the space map shows its size and notes that the dependencies download again on the next build.

Download SiftMac · scanning is free, and so is your first 2 GB of cleaning · See how it works