Android Studio, Gradle and AVDs: where your gigabytes go
Android development piles up space in three places: Gradle (dependencies and builds), the SDK (system images and NDKs) and the emulators. Paths below are for macOS; on Linux the SDK lives in ~/Android/Sdk instead of ~/Library/Android/sdk.
1. Measure
du -sh ~/.gradle/* ~/.android/* ~/Library/Android/sdk/* 2>/dev/null | sort -h
2. Gradle 🟢
~/.gradle/caches— downloaded dependencies and the build cache. They come back on the next build (slower, and it needs internet).~/.gradle/wrapper/dists— a full Gradle distribution for every version any project ever asked for. Old ones rarely get used again.~/.gradle/daemon— daemon logs.
# stop the daemons before deleting
./gradlew --stop
rm -rf ~/.gradle/caches ~/.gradle/daemon
ls ~/.gradle/wrapper/dists # delete versions no project uses
3. Emulators (AVD) 🟡
Each emulator in ~/.android/avd holds the virtual device's disk: installed apps, data and snapshots. Deleting it loses that state.
avdmanager list avd
avdmanager delete avd -n Pixel_8_API_35
Or in Android Studio: Device Manager › the emulator's menu › Delete.
4. System images and NDK 🟡
Each emulator Android version (sdk/system-images) and each NDK (sdk/ndk/<version>) takes a few GB. Remove the ones you don't use in Android Studio's SDK Manager (SDK Platforms/SDK Tools tabs, with "Show Package Details") or from the terminal:
sdkmanager --list_installed
sdkmanager --uninstall "system-images;android-34;google_apis;arm64-v8a"
ndkVersion your projects' build.gradle asks for before deleting an NDK.5. Android caches 🟢
~/.android/cache and ~/.android/build-cache are recreated. Android Studio's own caches live in ~/Library/Caches/Google/AndroidStudio*; old Android Studio versions leave folders that can go.
In Limpa Tudo, Gradle and Android caches show up as 🟢; emulators, system images and NDKs as 🟡, with an extra confirmation.