What is ~/Library/Android/sdk? Is it safe to delete?
Do not delete ~/Library/Android/sdk if you build Android apps: Android Studio, Flutter and React Native all need it. You can safely remove old platform versions and system images you no longer use, through the SDK Manager.
Where it is
~/Library/Android/sdkWhat it is
The Android SDK is the toolkit for building Android apps. Android Studio downloads it to ~/Library/Android/sdk the first time it runs, and adds to it as your projects ask for more.
The largest folders are usually system-images, which holds the Android versions the emulator can boot, followed by platforms, build-tools and ndk. Each Android version you have ever targeted adds its own copy.
Nothing is removed automatically. A Mac used for Android work for a few years collects platforms and images for Android versions nobody tests any more.
How big it gets
Commonly ten GB or more, and several tens of GB with many system images or NDK versions installed.
How to clear it by hand
- Run the command below to see which parts of the SDK are largest.
- In Android Studio, choose Tools, then SDK Manager.
- On the SDK Platforms tab, tick Show Package Details and untick the Android versions and system images you no longer need.
- On the SDK Tools tab, with Show Package Details ticked, untick old Build-Tools and NDK versions.
- Click Apply. Android Studio deletes the unticked packages. Keep the versions your current projects compile against.
du -sh ~/Library/Android/sdk/*What happens afterwards
A project that needs a removed platform or build tools version fails to build until it is downloaded again, and Android Studio usually offers to do that. Emulators that used a removed system image no longer start.
How Diskzy handles it
Diskzy shows the SDK and the size of each part on the disk map, so you can tell whether system images, platforms or the NDK are taking the space before you open the SDK Manager.
Related guides
- Android emulators (AVD)~/.android/avd
- Gradle caches~/.gradle/caches
- JetBrains caches~/Library/Caches/JetBrains
See where your Mac's space went
Diskzy maps your disk, explains System Data and clears what's safe. Free for 72 hours, then $9 once for 2 Macs.
Try Diskzy for free