Is it safe to delete ~/.gradle on Mac?

Safe with care~/.gradle

Only the caches. What ~/.gradle holds, which parts Gradle rebuilds, which hold your settings and secrets, and how to free space without losing them.

Updated 16 November 2026 · 3 min read

Verdict: Safe with care. You can delete ~/.gradle/caches, and Gradle downloads and rebuilds what it needs on the next build. Don't delete the whole ~/.gradle folder, though: gradle.properties and init.d hold your global settings, and gradle.properties is where Gradle's own docs suggest supplying repository credentials.

What lives in ~/.gradle

~/.gradle is Gradle's user home, unless you set GRADLE_USER_HOME to put it somewhere else. Gradle, the Gradle Wrapper in each project and Android Studio builds all use it. Gradle's directory layout docs list what goes in it:

  • caches: downloaded dependencies and other on-disk caches that make repeat builds faster. This is usually the big one.
  • wrapper/dists: the Gradle versions downloaded by the Wrapper, one folder per version.
  • daemon: the registry and logs of the Gradle Daemon, the background process that keeps builds fast.
  • init.d: global initialisation scripts that run before every build.
  • gradle.properties: global configuration properties. Gradle's guide to securing repositories tells you to supply repository credentials through properties rather than build scripts, and says to treat this file with care.

What happens if you delete it

  • caches: the next build of every project downloads its dependencies again and redoes work it had cached. Expect a slow first build that needs a network connection, and offline builds will fail until the cache refills.
  • wrapper/dists: each project's Wrapper downloads its Gradle version again the next time you run it. The Wrapper docs say it downloads any missing distribution and stores it in the Gradle user home.
  • daemon: you lose the daemon's old logs. Stop running daemons first so nothing is writing there.
  • gradle.properties and init.d: lost for good unless you have a backup. Builds that need credentials stop authenticating, and anything your init scripts set up stops happening.

Gradle also tidies up after itself. Its docs say it automatically removes unused entries after 30 days for downloaded resources and released Wrapper versions, and after 7 days for resources it created and build cache entries. A large caches folder therefore usually belongs to things you used recently.

How to check its size safely

This only reads, and lists each part of the folder by size, biggest last:

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

To see which Wrapper versions you have:

ls ~/.gradle/wrapper/dists

In Finder, choose Go > Go to Folder, type ~/.gradle and press Return. The folder is hidden because its name starts with a dot. Select caches and choose File > Get Info for its size.

On the macOS 15.5 Mac we checked this on, there was no ~/.gradle at all, because neither Gradle nor Android Studio had been used there.

The safest way to get the space back

  1. Quit Android Studio or IntelliJ IDEA, and stop any running Gradle daemons from inside a project with ./gradlew --stop. This stops the background processes and deletes nothing.
  2. Move the cache to the Bin, so you can still put it back:
trash ~/.gradle/caches

The trash command comes with macOS 14 Sonoma and later.

  1. If you want more space, open ~/.gradle/wrapper/dists in Finder and move the folders for Gradle versions none of your projects use to the Bin.
  2. Build a project you work on to check everything still works, then empty the Bin.

Warning: rm -rf ~/.gradle deletes gradle.properties and init.d along with the caches, skipping the Bin. Clear caches on its own instead.

What never to touch

  • gradle.properties and init.d. Back them up before any big clear-out.
  • caches while a build or daemon is running. Stop them first.
  • gradlew and gradle/wrapper inside your projects. They are part of the project and belong in version control.

Java developers often have a large Maven repository too, covered on the ~/.m2 page, and Rust's equivalent is on the ~/.cargo page. For caches across the rest of the Mac, see the guide to clearing cache on a Mac.

How Headroom helps

Headroom's Clean scan lists ~/.gradle/caches under Developer caches once it passes 1 MB, with the note that Gradle downloads again on the next build. It is ticked by default and deleted for good when you clean. Headroom never touches gradle.properties, init.d, the daemon folder or Wrapper versions. It doesn't check for a running Gradle daemon, so stop your builds first. The scan is free, and the $19 one-time licence clears what you tick, on up to three Macs. Read about the cleaner or download Headroom.

Questions

Can I delete ~/.gradle/caches?

Yes. Gradle downloads and rebuilds what it needs on the next build, which will be slower and needs a network connection. Stop running builds and Gradle daemons first.

What is in ~/.gradle/wrapper/dists?

The Gradle versions that the Wrapper in your projects downloaded. Delete a version and the Wrapper fetches it again the next time a project asks for it.

Does Gradle clean its own cache?

Yes. Gradle removes unused cache entries automatically, after 30 days for downloaded resources and released Wrapper versions, and after 7 days for things it created, such as build cache entries.

What should I keep from ~/.gradle?

gradle.properties and the init.d folder. They hold your global settings and scripts, and gradle.properties can also hold repository passwords and signing details.