Android Studio taking up space on your Mac: what can you delete?
When Android Studio is taking up space on a Mac, the app itself is the small part. The bulk is emulators, the SDK's system images, Gradle's download caches and each project's build folders, spread over several hidden folders in your home folder.
The short answer: delete emulators you don't use in Device Manager, and system images you no longer test on in SDK Manager. Gradle's caches (~/.gradle/caches and ~/.gradle/wrapper/dists) and Maven's ~/.m2/repository are downloads: safe to delete with Android Studio closed, and the next build fetches what it needs. Libraries you put in the Maven repository yourself with mvn install or publishToMavenLocal only come back when you rebuild them. Empty Flutter's ~/.pub-cache with dart pub cache clean. Build folders go with ./gradlew clean.
Where does Android Studio use space on a Mac?
- Emulators (AVDs):
~/.android/avd, one folder per virtual device with its disk images and snapshots. - SDK:
~/Library/Android/sdk, the location shown in SDK Manager as Android SDK Location. Emulator system images are in itssystem-imagesfolder. - Gradle:
~/.gradle/caches(dependencies and build caches) and~/.gradle/wrapper/dists(one full Gradle per version your projects ask for). - Maven:
~/.m2/repository, if you build with Maven or publish libraries locally. - Flutter and Dart:
~/.pub-cache, the packagesflutter pub getdownloads. - Android Studio itself: settings in
~/Library/Application Support/Google/AndroidStudio<version>, caches and indexes in~/Library/Caches/Google/AndroidStudio<version>, logs in~/Library/Logs/Google/AndroidStudio<version>. - Each project: its
buildfolders and a.gradlefolder; Flutter projects also have.dart_tool.
To see the sizes yourself:
du -sh ~/.android/avd ~/Library/Android/sdk/system-images ~/.gradle/caches ~/.gradle/wrapper/dists ~/.m2/repository ~/.pub-cache 2>/dev/null
How do I delete an Android emulator on a Mac?
- In Android Studio, choose View › Tool Windows › Device Manager. From the Welcome screen it's under More Actions › Virtual Device Manager.
- Click the menu (⋮) next to the device and choose Delete.
The same menu has Wipe Data, which keeps the device but empties its user data, and Show on Disk. An emulator holds the apps and data you put on it; deleting it doesn't touch the system image it was made from, so you can create a new one in a minute. With the SDK's command-line tools installed, avdmanager list avd and avdmanager delete avd -n <name> do the same.
How do I remove Android SDK system images?
- Open Tools › SDK Manager.
- Find each system image you no longer test on and clear its checkbox. A red X marks it for removal.
- Click Apply or OK and confirm.
Remove images through SDK Manager rather than the Finder, so the SDK's list of installed packages stays right. Emulators that use a removed image stop starting, so delete those first. From Terminal, sdkmanager --list shows what's installed and sdkmanager --uninstall "system-images;android-34;google_apis;arm64-v8a" removes one, using the exact package name from that list.
Is it safe to clean the Gradle cache?
Yes. Everything in ~/.gradle/caches and ~/.gradle/wrapper/dists is downloaded or rebuilt; the next build is slower and needs the network, nothing more. Quit Android Studio, stop the Gradle daemons from a project folder, then move the two folders to the Trash:
./gradlew --stop
du -sh ~/.gradle/caches ~/.gradle/wrapper/dists
Gradle already removes cache entries it hasn't used for 30 days, so what's left is mostly what your current projects use. Deleting wrapper/dists pays off most when old projects pinned Gradle versions you no longer build with. Leave ~/.gradle/gradle.properties and init.d alone: those are your settings. The same goes for Maven's ~/.m2/repository (keep ~/.m2/settings.xml), except that libraries you installed there with mvn install or publishToMavenLocal only come back when you rebuild them. For Flutter, run dart pub cache clean rather than deleting ~/.pub-cache by hand: it asks before it empties the folder. Either way, tools you installed with dart pub global activate live in that folder and go too, so activate them again afterwards.
How do I clean an Android project's build folders?
cd ~/path/to/project
./gradlew clean
./gradlew clean deletes the project's build folders; the next build recreates them. For a Flutter project, flutter clean deletes build and .dart_tool. The per-project .gradle folder is a cache too and comes back on the next sync. Projects you've finished with are where this adds up, since nothing cleans their build output on its own.
What about folders from older Android Studio versions?
Each version keeps its own AndroidStudio<version> folders in ~/Library/Application Support/Google, ~/Library/Caches/Google and ~/Library/Logs/Google. The first time you run a new major version, Android Studio shows a Delete Unused Android Studio Directories dialog with the folders of versions it can't find installed, their sizes and an option to delete them. If you missed that, the folders of old versions are safe to move to the Trash; keep the ones whose version matches the Android Studio you run now, since they hold your settings and plugins. Xcode leaves the same kind of leftovers: Xcode taking up too much space: what's safe to delete. For JavaScript and Rust caches next to these, see How to find and delete old node_modules folders and package caches on a Mac.