Skip to content

Android Studio is small, and the SDK beside it is not

The IDE, the SDK, system images and emulator data across four folders. What each costs and which are safe.

5 min read

Android Studio itself is a couple of gigabytes. What makes an Android machine full is everything around it: a system image per API level, a virtual device per configuration, and Gradle's caches.

The four folders

$paths = @(
  "$env:LOCALAPPDATA\Android\Sdk",
  "$env:USERPROFILE\.android",
  "$env:USERPROFILE\.gradle",
  "$env:LOCALAPPDATA\Google\AndroidStudio*"
)
foreach ($p in $paths) {
  Get-Item $p -EA SilentlyContinue | ForEach-Object {
    $s = (Get-ChildItem $_.FullName -Recurse -Force -File -EA SilentlyContinue | Measure-Object Length -Sum).Sum
    '{0,8:N0} MB  {1}' -f ($s/1MB), $_.FullName
  }
}
FolderWhat it isSafe to remove
Sdk\system-imagesA full Android per API level and ABIYes, with sdkmanager
Sdk\platformsSDK per API levelYes, if nothing targets it
Sdk\ndkNative development kits, several GB eachYes, if you do not build native
.android\avdVirtual devices and their data partitionsYes, through Device Manager
.gradleDependency caches and distributionsYes, refetched

Removing SDK packages properly

cd $env:LOCALAPPDATA\Android\Sdk\cmdline-tools\latest\bin
.\sdkmanager.bat --list_installed
.\sdkmanager.bat --uninstall "system-images;android-30;google_apis;x86_64"

Using sdkmanager keeps the SDK's own manifest accurate. Deleting folders directly leaves Android Studio believing packages are present and offering to repair an install that looks damaged.

Virtual devices are separate

An AVD keeps its own data partition, and a device used for testing accumulates whatever was installed into it. Device Manager inside Android Studio can wipe a device's data without deleting it, which reclaims most of the space and keeps the configuration.

What your projects actually need

Get-ChildItem $env:USERPROFILE -Recurse -Filter build.gradle* -Depth 4 -EA SilentlyContinue |
  Select-String -Pattern 'compileSdk|targetSdk' | Select-Object -ExpandProperty Line -Unique

Anything installed well below the lowest API level your projects target, and not used by an emulator you keep, is a candidate. The Gradle side of this is covered in Java and the build caches.

Common questions

Where is the Android SDK on Windows?

By default in %LOCALAPPDATA%\Android\Sdk, with virtual devices under %USERPROFILE%\.android\avd and Gradle caches under %USERPROFILE%\.gradle.

How do I remove old Android system images?

Use sdkmanager --list_installed to see what is there, then sdkmanager --uninstall with the package name. That keeps the SDK manifest consistent, unlike deleting folders.

Why do emulators use so much space?

Each virtual device has its own data partition holding everything installed into it. Wiping a device's data from Device Manager reclaims most of it while keeping the configuration.

Is the NDK safe to remove?

Yes, if you do not build native code. Each version is several gigabytes and they accumulate, so removing versions no project references is usually a significant reclaim.

Read next