AVD data directory

The AVD data directory, also called the content directory, is specific to a single AVD instance and contains all modifiable data for the AVD.

The default location is the following, where name is the AVD name:

·         Mac OS X and Linux - ~/.android/avd/name.avd/

·         Microsoft Windows XP - C:\Documents and Settings\user\.android\name.avd\

·         Windows Vista, and higher - C:\Users\user\.android\name.avd\

Use the -datadir option to specify a different AVD data directory.

The following table lists the most important files contained in this directory.

 

File

Description

Option to Specify a Different File

userdata-qemu.img

The content of the data partition, which appears as data/ in the emulated system. When you create a new AVD, or when you use the -wipe-data option to reset the AVD to the factory defaults, the emulator copies the userdata.img file in the system directory to create this file.

Each virtual device instance uses a writable user-data image to store user- and session-specific data. For example, it uses the image to store a unique user's installed app data, settings, databases, and files. Each user has a different ANDROID_SDK_HOME directory that stores the data directories for the AVDs created by that user; each AVD has a single userdata-qemu.img file.

-data

cache.img

The cache partition image, which appears as cache/ in the emulated system. It's empty when you first create an AVD or use the -wipe-data option. It stores temporary download files and is populated by the download manager and sometimes the system; for example, the browser uses it to cache downloaded web pages and images while the emulator is running. When you power off the virtual device, the file is deleted. You can persist the file by using the -cache option.

-cache

sdcard.img

(Optional) An SD card partition image that lets you simulate an SD card on a virtual device. You can create an SD card image file in the AVD Manager or using the mksdcard tool. The file is stored on your development computer and must be loaded at startup.

When defining an AVD in the AVD Manager, you have the choice to use an automatically managed SD card file, or a file that you created with the mksdcard tool. You can view the sdcard.img file associated with an AVD in the AVD Manager. The -sdcard option overrides the SD card file specified in the AVD.

You can browse, send files to, and copy and remove files from a simulated SD card by using the emulator UI or the adb utility while the virtual device is running. You can't remove a simulated SD card from a running virtual device.

To copy files to the SD card file before loading it, you can mount the image file as a loop device and then copy the files. Or use a utility such as the mtools package to copy the files directly to the image.

The emulator treats the file as a pool of bytes so the SD card format doesn't matter.

Note that the -wipe-data option doesn't affect this file. If you want to clear the file, you need to delete the file and then recreate it using the AVD Manager or the mksdcard tool. Changing the size of the file also deletes the file and creates a new file.