Android Virtual Devices (AVDs) are configurations of emulator options that let you better model an actual device.
Each AVD is made up of:
- A hardware profile. You can set options to define the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialling pad, how much memory it has, and so on.
- A mapping to a system image. You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on.
- Other options. You can specify the emulator skin you want to use with the AVD, which lets you control the screen dimensions, appearance, and so on. You can also specify the emulated SD card to use with the AVD.
- A dedicated storage area on your development machine, in which is stored the device’s user data (installed applications, settings, and so on) and emulated SD card.
You can create as many AVDs as you need, based on the types of devices you want to model and the Android platforms and external libraries you want to run your application on.
In addition to the options in an AVD configuration, you can also specify emulator command-line options at launch or by using the emulator console to change behaviors or characteristics at run time.
The easiest way to create an AVD is to use the graphical AVD Manager, which you can launch from Eclipse or from the command line using the
android tool. The
android tool is provided in the
tools/ directory of the Android SDK. When you run the
android tool without options, it launches the graphical AVD Manager.
Creating an AVD From Eclipse
To create an AVD:
- In Eclipse, choose Window > Android SDK and AVD Manager.
Alternatively, you can launch the graphical AVD Manager by running the
androidtool with no options.
- Select Virtual Devices in the left panel.
- Click New.
The Create New AVD dialog appears.
- Type the name of the AVD, such as "my_avd".
- Choose a target.
The target is the system image that you want to run on the emulator, from the set of platforms that are installed in your SDK environment. You can choose a version of the standard Android platform or an SDK add-on. For more information about how to add platforms to your SDK, see Adding SDK Components.
- Optionally specify any additional settings:
- SD Card
- The path to the SD card image to use with this AVD, or the size of a new SD card image to create for this AVD.
- The skin to use for this AVD, identified by name or dimensions.
- The hardware emulation options for the device. For a list of the options, see Setting hardware emulation options.
- Click Create AVD.
When you create a new AVD that uses a standard Android system image ("Type: platform"), the AVD Manager lets you set hardware emulation options for your virtual device.
Default location of the AVD files
When you create an AVD, the AVD Manager creates a dedicated directory for it on your development computer. The directory contains the AVD configuration file, the user data image and SD card image (if available), and any other files associated with the device. Note that the directory does not contain a system image — instead, the AVD configuration file contains a mapping to the system image, which it loads when the AVD is launched.
The AVD Manager also creates a
<AVD name>.ini file for the AVD at the root of the
.android/avd directory on your computer. The file specifies the location of the AVD directory and always remains at the root the .android directory.
By default, the AVD Manager creates the AVD directory inside
C:\Documents and Settings\<user>\.android\ on Windows XP.
AVD Quick View
- You need to create an AVD to run any app in the Android emulator
- Each AVD is a completely independent virtual device, with its own hardware options, system image, and data storage.
- You create AVD configurations to model different device environments in the Android emulator.
- You can launch a graphical Android AVD Manager either through Eclipse or through the
androidtool also offers a command-line interface for creating and managing AVDs.