Skip to content

Android Studio quietly keeps 100 GB across four folders

Emulator images, Gradle caches, SDK platforms and build output accumulate with nothing ever clearing them. Here is what each is and what is safe to remove.

  • Android Studio
  • Developer
  • Cleanup

Android Studio is the heaviest development tool most Macs carry, and the application itself is a small part of it. The rest is spread across four directories that grow with every project and every SDK update, and nothing ever prunes them.

The four

PathWhat it holdsTypicalSafe to delete
~/.gradle/cachesEvery dependency version ever resolved10 to 40 GBYes, redownloads
~/Library/Android/sdkPlatforms, build tools, NDK10 to 60 GBSelectively, via SDK Manager
~/.android/avdEmulator images, one per virtual device8 to 40 GBYes, per device
build/ in each projectCompiled output1 to 5 GB eachYes, regenerates

Gradle, the one nobody looks at

Gradle caches every version of every dependency it has ever resolved, forever. Bump a library version and both copies stay. Across a few years this is routinely the largest of the four.

du -sh ~/.gradle/caches
rm -rf ~/.gradle/caches

Deleting it is safe. The next build redownloads what that build needs, which is slow once and then normal again. The important detail is that it redownloads only what is still used, which is why the folder comes back much smaller.

Emulator images

Each virtual device is a full Android system image plus its user data, commonly 6 to 12 GB. Create one per API level over a couple of years and this dominates. List them with:

~/Library/Android/sdk/emulator/emulator -list-avds

Delete the ones you do not use from Android Studio's Device Manager, which removes the image and its data together. Deleting the folders by hand leaves the definitions behind and confuses the tooling.

The SDK, and the part worth keeping

~/Library/Android/sdk holds every platform version you have ever installed. Most projects target one or two. Open Android Studio, SDK Manager, and untick the platforms you do not build against.

What this adds up to

On a machine doing Android work for a year or two, 60 to 120 GB across these four is normal and nearly all of it is reclaimable. If the same machine also does iOS or web work, add Xcode's folders and node_modules and the total is usually most of what is missing from the drive.

Common questions

Is it safe to delete the Gradle cache?

Yes. Everything in ~/.gradle/caches is downloaded artefacts and resolved dependency metadata, all reproducible from your build files. The next build refetches what it needs, which is slower once. The folder usually comes back substantially smaller, because it only refetches versions still in use.

How much space do Android emulators use?

Each virtual device is typically 6 to 12 GB, made up of the system image plus its user data. Several devices across different API levels commonly reach 30 to 40 GB. Delete unused ones from Android Studio's Device Manager rather than by hand, so the definitions are removed too.

Can I delete the Android SDK folder?

Not wholesale, because Android Studio needs it to build anything. Use the SDK Manager to untick platform versions and build tools you no longer target, which is the same reclamation done safely. The NDK is worth removing outright if you do not build native code.

Read next