What is ~/.android/avd, and can you delete it?

The ~/.android/avd folder holds every Android virtual device you created, each with its own disk image and app data, so delete unused ones through Device Manager rather than all at once.

Shiva ChandraMaker of Clean House · · 2 min read
Short answer

~/.android/avd is the folder where Android Studio keeps your emulators, called Android Virtual Devices. Each has its own disk image and data. Look before deleting. Remove emulators you no longer use in Device Manager or with avdmanager, and keep the rest of ~/.android, which also holds your adb key.

Path
~/.android/avd
What it is
Android Virtual Devices (emulators), each with its own disk and settings
Typical size
Often 2 to 10 gigabytes per emulator, more with large storage settings
Made by
Android Studio and the Android Emulator
Safe to delete?
Look first
Comes back?
No. The emulator and any apps and data inside it are gone, though you can create a new one

What is in this folder?

Each emulator is a .avd folder with disk images, a config.ini and a snapshot of its state, plus a matching .ini file next to it. Android's documentation describes an AVD as a configuration that defines the characteristics of a device you want to simulate in the emulator.

The emulator's Android versions are separate. They are system images, stored in the Android SDK, and they can be larger than the emulator folders themselves.

Is it safe to delete?

Not all at once. An emulator may hold a signed-in Google account, test data or a configured app state. Deleting its folder deletes that. But an emulator you have not started in months is just a big disk image, and you can recreate it in a minute.

Do not delete emulators while one is running. Close the emulator window first.

How do I clear it by hand?

  1. Quit the emulator and Android Studio.
  2. Open Android Studio, then Device Manager, and delete the emulators you do not use.
  3. Or use the command line, which also tidies the matching .ini file.
avdmanager list avd
avdmanager delete avd -n <name>
Do not delete all of ~/.android. It contains adbkey, the key your Mac uses to talk to your phones.

How do I stop it growing?

Create emulators with smaller storage and delete test devices when a project ends. Cold-boot snapshots add space too.

How Clean House handles it

Clean House reads each emulator's name from its config.ini so you see "Pixel 8" instead of a folder name, rates it Look first, and points to Device Manager as the way to delete it. It will not move an emulator while the emulator process is running, and it never offers the whole .android folder, only its avd and cache subfolders.

Questions

Is it safe to delete ~/.android/avd?

Only for emulators you no longer need. Each one holds its own apps and data, so look first and delete through Device Manager.

Where are Android emulators stored on Mac?

In ~/.android/avd, one .avd folder per virtual device.

What is the adbkey in ~/.android?

It is the key your Mac uses to authorize adb connections to devices. Keep it.

Sources

  1. Android Developers: Create and manage virtual devices
  2. Android Developers: avdmanager