From c46efe6696ff5532335102cb381ca2ca6a9d4261 Mon Sep 17 00:00:00 2001 From: Katie McCormick Date: Thu, 8 Jul 2010 15:24:16 -0700 Subject: Doc change: Update AVD create instructions. Change-Id: Icb1a8200d1b8de4aedea0718a014ab57e057235d --- docs/html/guide/developing/tools/avd.jd | 269 ++++++++++++-------------------- 1 file changed, 98 insertions(+), 171 deletions(-) (limited to 'docs/html/guide') diff --git a/docs/html/guide/developing/tools/avd.jd b/docs/html/guide/developing/tools/avd.jd index acebb7e..ca197cf 100644 --- a/docs/html/guide/developing/tools/avd.jd +++ b/docs/html/guide/developing/tools/avd.jd @@ -11,16 +11,13 @@ page.title=Android Virtual Devices hardware options, system image, and data storage.
  • You create AVD configurations to model different device environments in the Android emulator.
  • -
  • The android tool offers a graphical Android AVD - Manager and a command-line interface for creating AVDs.
  • - +
  • You can launch a graphical Android AVD Manager either through Eclipse or +through the android tool. The android tool also offers +a command-line interface for creating and managing AVDs.
  • In this document

    1. Creating an AVD
        -
      1. Listing targets
      2. -
      3. Selecting a target
      4. -
      5. Creating the AVD
      6. Setting hardware emulation options
      7. Default location of the AVD files
      @@ -74,15 +71,12 @@ reference of emulator options, please see the Emulator documentation.

      -

      To create and manage AVDs, you use the android tool provided in -the tools/ directory of the Android SDK. The tool provides both a -graphical AVD manager and a command-line interface that you can use to -create AVDs. To access the graphical AVD manager, run the -android tool without options. The sections below describe how to -use the android command-line interface to create and manage AVDs. -Note that some functionality, such as the capability to create an AVD with a -custom hardware configuration, are only available through the command-line -interface.

      +

      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.

      For more information about how to work with AVDs from inside your development environment, see - -

      To create an AVD, you use the android tool, a command-line -utility available in the <sdk>/tools/ directory. Managing -AVDs is one of the two main function of the android tool (the other -is creating and updating Android projects). Open a terminal window and change to -the <sdk>/tools/ directory, if needed

      - -

      To create each AVD, you issue the command android create avd, -with options that specify a name for the new AVD and the system image you want -to run on the emulator when the AVD is invoked. You can specify other options on -the command line also, such as to create an emulated SD card for the new AVD, set -the emulator skin to use, or set a custom location for the AVD's files.

      - -

      Here's the command-line usage for creating an AVD:

      - -
      android create avd -n <name> -t <targetID> [-<option> <value>] ... 
      - -

      You can use any name you want for the AVD, but since you are likely to be -creating multiple AVDs, you should choose a name that lets you recognize the -general characteristics offered by the AVD.

      - -

      As shown in the usage above, you must use the -t (or ---target) argument when creating a new AVD. The argument sets up a -mapping between the AVD and the system image that you want to use whenever the -AVD is invoked. You can specify any Android system image that is available in -your local SDK — it can be the system image of a standard Android platform -version or that of any SDK add-on. Later, when applications use the AVD, they'll -be running on the system that you specify in the -t argument.

      - -

      To specify the system image to use, you refer to its target ID -— an integer — as assigned by the android tool. The -target ID is not derived from the system image name, version, or API Level, or -other attribute, so you need to have the android tool list the -available system images and the target ID of each, as described in the next -section. You should do this before you run the android create -avd command. -

      - -

      Listing targets

      - -

      To generate a list of system image targets, use this command:

      - -
      android list targets
      - -

      The android tool scans the <sdk>/platforms and -<sdk>/add-ons directories looking for valid system images and -then generates the list of targets. Here's an example of the command output: -

      - -
      Available Android targets:
      -id:1
      -    Name: Android 1.1
      -    Type: platform
      -    API level: 2
      -    Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
      -id:2
      -    Name: Android 1.5
      -    Type: platform
      -    API level: 3
      -    Skins: HVGA (default), HVGA-L, HVGA-P, QVGA-L, QVGA-P
      -id:3
      -    Name: Google APIs
      -    Type: add-on
      -    Vendor: Google Inc.
      -    Description: Android + Google APIs
      -    Based on Android 1.5 (API level 3)
      -    Libraries:
      -    * com.google.android.maps (maps.jar)
      -        API for Google Maps
      -    Skins: HVGA (default), HVGA-L, QVGA-P, HVGA-P, QVGA-L
      - -

      Selecting a target

      - -

      Once you have generated the list of targets available, you can look at the -characteristics of each system image — name, API Level, external -libraries, and so on — and determine which target is appropriate for the -new AVD.

      - -

      Keep these points in mind when you are selecting a system image target for -your AVD:

      -
      - -

      Creating the AVD

      - -

      When you've selected the target you want to use and made a note of its ID, -use the android create avd command to create the AVD, supplying the -target ID as the -t argument. Here's an example that creates an -AVD with name "my_android1.5" and target ID "2" (the standard Android 1.5 -system image in the list above):

      - -
      android create avd -n my_android1.5 -t 2
      - -

      If the target you selected was a standard Android system image ("Type: -platform"), the android tool next asks you whether you want to -create a custom hardware profile.

      -
      Android 1.5 is a basic Android platform.
      -Do you wish to create a custom hardware profile [no]
      - -

      If you want to set custom hardware emulation options for the AVD, enter -"yes" and set values as needed. If you want to use the default hardware -emulation options for the AVD, just press the return key (the default is "no"). -The android tool creates the AVD with name and system image mapping you -requested, with the options you specified. - -

      If you are creating an AVD whose target is an SDK add-on, the -android tool does not allow you to set hardware emulation options. -It assumes that the provider of the add-on has set emulation options -appropriately for the device that the add-on is modeling, and so prevents you -from resetting the options.

      -

      For a list of options you can use in the android create avd -command, see the table in Command-line options for AVDs, -at the bottom of -this page.

      +

      The easiest way to create an AVD is to use the graphical AVD Manager, but the +android tool also offers a command line option.

      +

      To create an AVD:

      +
        +
      1. In Eclipse, choose Window > Android SDK and AVD Manager.
      2. +

        Alternatively, you can launch the graphical AVD Manager by running the +android tool with no options.

        +
      3. Select Virtual Devices in the left panel.
      4. + +
      5. Click New.
      6. + +

        The Create New AVD dialog appears.

        AVD
+Dialog + +
      7. Type the name of the AVD, such as "my_avd".
      8. +
      9. Choose a target.
      10. +

        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.

        +
      11. Optionally specify any additional settings:
      12. +
        +
        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.
        +
        Skin
        +
        The skin to use for this AVD, identified by name or dimensions.
        +
        Hardware
        +
        The hardware emulation options for the device. For a list of the options, see +Setting hardware emulation options.
        + +
      13. Click Create AVD.
      14. +

      Setting hardware emulation options

      -

      When are creating a new AVD that uses a standard Android system image ("Type: -platform"), the android tool lets you set hardware emulation -options for virtual device. The table below lists the options available and the +

      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. +The table below lists the options available and the default values, as well as the names of properties that store the emulated -hardware options in the AVD's configuration file (the config.ini file in the +hardware options in the AVD's configuration file (the config.ini file in the AVD's local directory).

      @@ -266,6 +165,7 @@ AVD's local directory).

      + @@ -299,6 +199,7 @@ AVD's local directory).

      + @@ -311,6 +212,7 @@ AVD's local directory).

      + @@ -323,6 +225,7 @@ AVD's local directory).

      + @@ -335,6 +238,7 @@ AVD's local directory).

      + @@ -347,43 +251,55 @@ AVD's local directory).

      + - + + + + + + +
      Keyboard support Whether the device has a QWERTY keyboard. Default value is "yes". hw.keyboard Maximum vertical camera pixels Default value is "480". hw.camera.maxVerticalPixels
      Battery support Whether the device can run on a battery. Default value is "yes". hw.battery
      Audio recording support Whether the device can record audio. Default value is "yes". hw.audioInput
      SD Card support Whether the device supports insertion/removal of virtual SD Cards. Default value is "yes". hw.sdCard
      Cache partition size Default value is "66MB". disk.cachePartition.size
      Abstracted LCD densitySets the generalized density characteristic used by the AVD's screen. Default value is "160".Sets the generalized density characteristic used by the AVD's screen. Most +skins come with a value (which you can modify), but if a skin doesn't provide +its own value, the default is 160. hw.lcd.density
      Max VM application heap sizeThe maximum heap size a Dalvik application might allocate before being +killed by the system. Value is in megabytes. Most skins come with a value (which +you can modify), but if a skin doesn't provide its own value, the default is +16.vm.heapSize

      Default location of the AVD files

      -

      When you create an AVD, the android tool creates a dedicated directory for it +

      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 android tool 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.

      +

      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 android tool creates the AVD directory inside +

      By default, the AVD Manager creates the AVD directory inside ~/.android/avd/ (on Linux/Mac), C:\Documents and Settings\<user>\.android\ on Windows XP, and C:\Users\<user>\.android\ on Windows Vista. If you want to use a custom location for the AVD directory, you can do so by using the -p <path> option when -you create the AVD:

      +you create the AVD (command line tool only):

      android create avd -n my_android1.5 -t 2 -p path/to/my/avd
      -

      If the .android directory is hosted on a network drive, we recommend using +

      If the .android directory is hosted on a network drive, we recommend using the -p option to place the AVD directory in another location. -The AVD's .ini file remains in the .android directory on the network +The AVD's .ini file remains in the .android directory on the network drive, regardless of the location of the AVD directory.

      Managing AVDs

      @@ -401,18 +317,15 @@ options for AVDs at the bottom of this page.

      Updating an AVD

      -

      If, for any reason, the platform/add-on root folder has its name changed (maybe because the user has installed an update of the platform/add-on) then the AVD will not be able to load the system image that it is mapped to. In this case, the android list targets command will produce this output: - -

      The following Android Virtual Devices could not be loaded: 
      -Name: foo 
      -Path: <path>/.android/avd/foo.avd 
      -Error: Invalid value in image.sysdir. Run 'android update avd -n foo' 
      - -

      To fix this error, use the android update avd command to recompute the path to the system images.

      +

      +If you rename or move the root directory of a platform (or add-on), an AVD configured to use that platform will no longer be able to load the system image properly. To fix the AVD, use the Repair... button in the AVD Manager. From the command line, you can also use the android update avd command to recompute the path to the system images.

      Deleting an AVD

      -

      You can use the android tool to delete an AVD. Here is the command usage:

      +

      You can delete an AVD in the AVD Manager by selecting the +AVD and clicking Delete.

      + +

      Alternatively, you can use the android tool to delete an AVD. Here is the command usage:

      android delete avd -n <name> 
      @@ -420,7 +333,21 @@ Error: Invalid value in image.sysdir. Run 'android update avd -n foo' specified name deletes the AVD's directory and files.

      -

      Command-line options for AVDs

      +

      Command-line options

      + +

      You can use the android tool to create and manage AVDs.

      + +

      The command line for creating an AVD has the following syntax:

      + +
      +android create avd -n <name> -t <targetID> [-<option> <value>] ... 
      +
      + +

      Here's an example that creates an AVD with the name "my_android2.2" and target ID "3":

      + +
      +android create avd -n my_android2.2 -t 3
      +

      The table below lists the command-line options you can use with the android tool.

      -- cgit v1.1