How to restore an Android emulator to its initial "factory" settings (wipe the data)

To restore an Android emulator to its initial, default settings, you need to find its “image” file on your filesystem and delete it. The image file will be found in your $HOME/.android/avd/<avdname>.avd folder.

For example, I was just working with an AVD named Nexus_6_API_21, and its directory on my Mac OS X system is /Users/al/.android/avd/Nexus_6_API_21.avd. I moved into that directory and found several “.img” files, deleted them, and then restarted the emulator, and it went back to its default settings.

Before this I was having a problem with the emulator/AVD, and I wanted to see if I could avoid deleting it and re-creating it, and this approach seems to work.

Note that I found this tip on Safari Books Online, though there was a little more to delete than that tip described.

Using Android Studio

I just found that this is easier to do if you’re using Android Studio. If so, open the AVD Manager, select your AVD, then choose the “Wipe Data” menu option. With Android Studio version 1.1, this is currently under the “Actions” items, on the right side of the AVD Manager dialog.