diff --git a/docs/html/images/studio-avdmgr-firstscreen.png b/docs/html/images/studio-avdmgr-firstscreen.png deleted file mode 100644 index 5da5c6c06e083..0000000000000 Binary files a/docs/html/images/studio-avdmgr-firstscreen.png and /dev/null differ diff --git a/docs/html/images/studio-avdmgr-selecthdwr.png b/docs/html/images/studio-avdmgr-selecthdwr.png deleted file mode 100644 index 015833af814ae..0000000000000 Binary files a/docs/html/images/studio-avdmgr-selecthdwr.png and /dev/null differ diff --git a/docs/html/images/tools/avd-configurehp.png b/docs/html/images/tools/avd-configurehp.png new file mode 100644 index 0000000000000..e053364a38ce8 Binary files /dev/null and b/docs/html/images/tools/avd-configurehp.png differ diff --git a/docs/html/images/tools/avd-hardwareprofile.png b/docs/html/images/tools/avd-hardwareprofile.png new file mode 100644 index 0000000000000..f4b6b464fa2c1 Binary files /dev/null and b/docs/html/images/tools/avd-hardwareprofile.png differ diff --git a/docs/html/images/tools/avd-main.png b/docs/html/images/tools/avd-main.png new file mode 100644 index 0000000000000..f3260026bf4f9 Binary files /dev/null and b/docs/html/images/tools/avd-main.png differ diff --git a/docs/html/images/tools/avd-systemimage.png b/docs/html/images/tools/avd-systemimage.png new file mode 100644 index 0000000000000..7026d847dddee Binary files /dev/null and b/docs/html/images/tools/avd-systemimage.png differ diff --git a/docs/html/images/tools/avd-verifyconfig.png b/docs/html/images/tools/avd-verifyconfig.png new file mode 100644 index 0000000000000..cd766907a5092 Binary files /dev/null and b/docs/html/images/tools/avd-verifyconfig.png differ diff --git a/docs/html/tools/devices/managing-avds.jd b/docs/html/tools/devices/managing-avds.jd index 4ca858846dbb6..8ba554e9d6260 100644 --- a/docs/html/tools/devices/managing-avds.jd +++ b/docs/html/tools/devices/managing-avds.jd @@ -1,297 +1,680 @@ -page.title=Managing AVDs with AVD Manager -parent.title=Managing Virtual Devices -parent.link=index.html +page.title=Managing AVDs with the AVD Manager @jd:body

In this document

-
    -
  1. Creating an AVD -
      -
    1. Creating a device definition
    2. -
    3. Hardware options
    4. -
    +
  2. Viewing and Managing Your AVDs
  3. +
  4. Creating an AVD
  5. +
  6. Creating a Hardware Profile
  7. +
  8. Working With Existing AVDs
  9. +
  10. Working With Existing Hardware Profiles
  11. +
  12. Running and Stopping an Emulator, and + Clearing Data
  13. +
  14. Importing and Exporting Hardware + Profiles
  15. +
  16. Hardware Profile Properties
  17. +
  18. AVD Properties
  19. Creating Emulator Skins
+

Dependencies and prerequisites

+
-

The AVD Manager is a tool you can use - to create and manage Android virtual devices (AVDs), which define device configurations - for the Android Emulator.

+

An Android Virtual Device (AVD) definition lets you define the + characteristics of an Android phone, tablet, Android Wear, or Android TV + device that you want to simulate in the + Android Emulator. + The AVD Manager helps you easily create and manage AVDs.

+ +

To effectively test your app, you should create an AVD that models each + device type that your app is designed to support. For example, we recommend + that you create an AVD for each API level that's equal to and higher than the + minimum version you've specified in your manifest + {@code <uses-sdk>} tag.

+ +

An AVD contains a hardware profile, system image, skin, and other + properties.

+ +

The hardware profile defines the characteristics of a device as + shipped from the factory. The AVD Manager comes preloaded with certain + hardware profiles, such as Nexus phone devices, and you can define and import + hardware profiles as needed. You can override some of the settings in your + AVD, if needed.

+ +

The AVD Manager helps you choose a system image for your AVD by providing + recommendations. It also lets + you download system images, some with add-on libraries, like Google APIs, + which your app might require. x86 system images run the fastest in the + emulator. Android Wear and Android TV devices tend to run best (and have + the largest installed base) on recent releases, while users of Android phones + and tablets tend to use slightly older releases, as shown in the + API level + dashboards.

+ +

An emulator skin specifies the appearance of a device. The AVD Manager + provides some predefined skins. You can also define your own, or use skins + provided by third parties.

+ +

Just as with a real device, for apps to use certains features defined in an + AVD, such as the camera, it must have the corresponding + <uses-feature> + setting in the app manifest.

+ +

Viewing and Managing Your AVDs

+ +

The AVD Manager lets you manage your AVDs all in one place.

+ +

To run the AVD Manager:

-

To launch the AVD Manager:

-

The AVD Manager main screen shows your current virtual devices, as shown in figure 1.

+

The AVD Manager appears.

+AVD Manager main window - -

Figure 1. The AVD Manager main screen shows your current - virtual devices.

+

It displays any AVDs you’ve already defined. When you first install +Android Studio, it creates one AVD. If you defined AVDs for Android Emulator +24.0.x or lower, you need to recreate them.

+

From this page you can:

-

Note: If you launch the AVD Manager from the command line, the UI -is different than how it appears in Android Studio, as documented here. Most of the same -functionality is available, but the command-line version of the AVD Manager -is currently not documented.

+

Creating an AVD

-

You can create as many AVDs as you would like to use with the Android Emulator. - To effectively test your app, you should create an AVD that models each device type for which - you have designed your app to support. For instance, you should create an AVD for each - API level equal to and higher than the minimum version you've specified in your manifest - {@code <uses-sdk>} tag.

+

You can create a new AVD from the beginning, or + duplicate an AVD and change some properties.

-

To create an AVD based on an existing device definition:

+

To create a new AVD:

    -
  1. From the main screen (figure 1), click Create Virtual Device.
  2. +
  3. From the + Your Virtual Devices page of + the AVD Manager, click Create Virtual Device.
  4. -
  5. In the Select Hardware window, select a device configuration, such as Nexus 6, - then click Next.

    +

    Alternatively, + run your + app from within Android Studio. In the Select Deployment Target + dialog, click Create New Emulator.

    + +

    The Select Hardware page appears.

    + Hardware Profile page of the AVD Manager + +
  6. Select a hardware profile, + and then click Next.
  7. + +

    If you don't see the hardware profile you want, you can + create + or import a hardware profile.

    + +

    The System Image page appears.

    + System Image page of the AVD Manager - -

    Figure 2. The Select Hardware window.

    -
  8. Select the desired system version for the AVD and click Next. +
  9. Select the system image for a particular API level, and then click + Next.
  10. -
  11. Verify the configuration settings, then click Finish. -

    If necessary, click Show Advanced Settings to select a custom skin - for the hardware profile and adjust other hardware settings.

    +

    The Recommended tab lists recommended system images. The + other tabs include a more complete list. The right pane describes the + selected system image. x86 images run the fastest in the emulator.

    +

    If you see Download next to the system image, you need + to click it to download the system image. You must be connected to the + internet to download it.

    + +

    The Verify Configuration page appears.

    + Verify Configuration page of the AVD Manager + +
  12. Change AVD properties as needed, + and then click Finish. +

    Click Show Advanced Settings to show more + settings, such as the skin.

  13. -
-

To launch the AVD in the Android Emulator, click the launch button - - in the list of AVDs.

+

The new AVD appears in the Your Virtual Devices page or the + Select Deployment Target dialog.

+ -

Creating a device definition

+

To create an AVD starting with a copy:

-

In case the available device definitions do not match the device type you'd like to emulate, -you can create a custom device definition for your AVD:

+
    +
  1. From the + Your Virtual Devices page of + the AVD Manager, right-click an AVD and select + Duplicate.
  2. + +

    Or click Menu + + and select Duplicate.

    + +

    The Verify Configuration + page appears.

    + +
  3. Click Change or Previous if you + need to make changes on the + System Image and + Hardware Profile pages.
  4. + +
  5. Make your changes, and then click Finish.
  6. + +

    The AVD appears in the Your Virtual Devices page. + +

+ + +

Creating a Hardware Profile

+ +

The AVD Manager provides predefined hardware profiles for common devices so +you can easily add them to your AVD definitions. If +you need to define a different device, you can create a new hardware profile. +You can define a new hardware profile from the beginning, +or copy a hardware profile as a start. The preloaded +hardware profiles aren't editable.

+ +

To create a new hardware profile from the beginning:

    -
  1. From the main screen (figure 1), click Create Virtual Device.
  2. -
  3. To begin you custom device by using an existing device profile as a template, select - a device profile then click Clone Device. -

    Or, to start from scratch, click New Hardware Profile.

    -
  4. -
  5. -

    The following Configure Hardware Profile window (figure 3) allows you to specify various -configurations such as the screen size, memory options, input type, and sensors.

    +
  6. In the Select Hardware + page, click New Hardware Profile.
  7. -

    When you're done configuring the device, click Finish.

    +
  8. In the Configure Hardware Profile page, change the + hardware profile properties as + needed.
  9. - -

    Figure 3. The Configure Hardware window when - creating a custom device configuration.

    - -
  10. Your custom device configuration is now available in the list of device definitions - (shown after you click Create Virtual Device). To continue preparing an AVD - with your custom device configuration, select the new configuration and follow the instructions - above to create an AVD with an existing device definition (and select your new definition).
  11. +
  12. Click Finish.
  13. +

    Your new hardware profile appears in the Select Hardware page. + You can optionally create an AVD + that uses the hardware profile + by clicking Next. Or, click Cancel to return + to the Your Virtual Devices page or Select Deployment Target + dialog.

    +
- +

To create a hardware profile starting with a copy:

+ +
    +
  1. In the Select Hardware + page, select a hardware profile and click Clone Device.
  2. + +

    Or right-click a hardware profile and select Clone. + +

  3. In the Configure Hardware Profile page, change the + hardware profile properties as + needed.
  4. + +
  5. Click Finish.
  6. + +

    Your new hardware profile appears in the Select Hardware page. + You can optionally create an AVD + that uses the hardware profile + by clicking Next. Or, click Cancel to return + to the Your Virtual Devices page or Select Deployment Target + dialog.

    +
+

Working With Existing AVDs

-

Hardware options

+

From the Your Virtual Devices page, you can + perform the following operations on an existing AVD:

+ -

If you are creating a new AVD, you can specify the following hardware options for the AVD -to emulate:

- - - +

Working With Existing Hardware Profiles

- +

From the Select Hardware page, +you can + perform the following operations on an existing hardware profile:

+ - +
  • To delete a hardware profile, right-click it and select + Delete.
  • + +

    You can't edit or delete the predefined hardware profiles.

    - - +

    Running and Stopping an Emulator, and Clearing Data

    - +

    From the Your Virtual Devices page, you can + perform the following operations on an emulator:

    + - - +

    Importing and Exporting Hardware Profiles

    - - +

    From the Select Hardware page, +you can import and export hardware profiles:

    + +
  • To export a hardware profile, right-click it and select + Export. Specify the location where you want to store the + XML file containing the definition. + -
  • - +

    Hardware Profile Properties

    - - +

    You can specify the following properties of hardware profiles in the +Configure Hardware Profile page. AVD +configuration properties override hardware profile properties, and emulator +properties that you set while the emulator is running override them both.

    - +

    The predefined hardware profiles included with the AVD Manager aren't +editable. However, you can copy them and edit the copies.

    - - - - +
    CharacteristicDescriptionProperty
    Device ram sizeThe amount of physical RAM on the device, in megabytes. Default value is "96".hw.ramSize
    Touch-screen supportWhether there is a touch screen or not on the device. Default value is "yes".hw.touchScreen
    Trackball supportWhether there is a trackball on the device. Default value is "yes".hw.trackBall
    Keyboard support
    + + + + + + + + + + + + - + + + + + + + - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + +
    Hardware Profile PropertyDescription
    Device NameName of the hardware profile. The name can contain uppercase or + lowercase letters, + numbers from 0 to 9, periods (.), underscores (_), and parentheses ( () ). + The name of the file storing the hardware profile is derived from the + hardware profile name. +
    Device TypeSelect one of the following: +
      +
    • Phone/Tablet +
    • Android Wear +
    • Android TV +
    +
    Whether the device has a QWERTY keyboard. Default value is "yes".
    Screen Size The physical size of the screen, in inches, measured at the diagonal. + If the size is larger than your computer screen, it’s reduced in size at + launch.
    Screen ResolutionType a width and height in pixels to specify the total number of pixels + on the simulated screen.hw.keyboard
    RoundSelect this option if the device has a round screen, such as an + Android Wear device.
    Memory: RAMType a RAM size for the device and select the units, one of B (byte), + KB (kilobyte), MB (megabyte), GB (gigabyte), or TB (terabyte).
    DPad support
    Input: Has Hardware Buttons (Back/Home/Menu)Select this option if your device has hardware navigation buttons. + Deselect it if these buttons are implemented in software only. If you + select this option, the buttons won’t appear on the screen. You can use the + emulator side panel to “press” the buttons, in either case.
    Input: Has Hardware KeyboardSelect this option if your device has a hardware keyboard. Deselect it + if it doesn’t. If you select this option, a keyboard won’t appear on the + screen. You can use your computer keyboard to send keystrokes to the + emulator, in either case.
    Navigation Style

    Select one of the following:

    +
      +
    • None - No hardware controls. Navigation is through the software. +
    • D-pad - Directional Pad support. +
    • Trackball +
    • Wheel +
    +

    These options are for actual hardware controls on the device itself. + However, + the events sent to the device by an external controller are the same.

    +
    Supported Device States

    Select one or both options:

    +
      +
    • Portrait - Oriented taller than wide. +
    • Landscape - Oriented wider than tall. +
    +

    If you select both, you can switch between orientations in the emulator. +You must select at least one option to continue.

    Cameras

    Select one or both options:

    +
      +
    • Back-Facing Camera - The lens faces away from the user. +
    • Front-Facing Camera - The lens faces toward the user. +
    +

    Later, you can use a webcam or a photo provided by the emulator to simulate +taking a photo with the camera.

    Whether the device has DPad keys. Default value is "yes".
    Sensors: AccelerometerSelect if the device has hardware that helps the device determine + its orientation.
    Sensors: GyroscopeSelect if the device has hardware that detects rotation or twist. + In combination with an + accelerometer, it can provide smoother orientation detection and support + a six-axis orientation system.
    Sensors: GPSSelect if the device has hardware that supports the Global Positioning + System (GPS) + satellite-based navigation system.
    Sensors: Proximity SensorSelect if the device has hardware that detects if the device is close + to your face during a + phone call to disable input from the screen.
    Default SkinSelect a skin that controls what the device looks like when displayed + in the + emulator. Remember that specifying a screen size that's too small for the + resolution can mean that the screen is cut off, so you can't see the whole + screen. See + Creating Emulator Skins + for more information.
    - hw.dPad - +

    AVD Properties

    - - GSM modem support +

    You can specify the following properties for AVD configurations +in the Verify Configuration page. +The AVD configuration specifies the interaction between the development +computer and the emulator, as well as properties you want to override in the +hardware profile.

    - Whether there is a GSM modem in the device. Default value is "yes". +

    AVD configuration properties override hardware profile properties, +and emulator +properties that you set while the emulator is running override them both.

    - hw.gsmModem - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - + + + + + + + + - - + + + + + + + + - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    AVD PropertyDescription
    AVD NameName of the AVD. The name can contain uppercase or + lowercase letters, + numbers from 0 to 9, periods (.), underscores (_), and parentheses ( () ). + The name of the file storing the AVD configuration is derived from the AVD + name. +
    AVD ID (Advanced)The AVD filename is derived from the ID, and you can use the ID to + refer to the AVD from the command line.
    Hardware ProfileClick Change to select a different hardware profile in + the Select Hardware page.
    System ImageClick Change to select a different system image in the + System Image page. + An active internet connection is required to download a new image.
    Camera support
    Startup: Scale Select the initial size you want to use when the emulator launches. + This size might be adjusted to a smaller size if it’s larger than the + computer screen. The default is Auto (automatic).
    Startup: Orientation

    Select one option for the initial emulator orientation:

    +
      +
    • Portrait - Oriented taller than wide. +
    • Landscape - Oriented wider than tall. +
    +

    An option is enabled only if it’s selected in the hardware profile. When +running the AVD in the emulator, you can change the orientation if portrait and +landscape are supported in the hardware profile.

    Camera (Advanced)

    Select one or both options:

    +
      +
    • Front - The lens faces away from the user. +
    • Back - The lens faces toward the user. +
    +

    This option is available only if it's selected in the hardware profile; it's +not available for Android Wear and Android TV.

    Whether the device has a camera. Default value is "no".
    Network: Speed (Advanced)

    Select a network protocol to determine the speed of data transfer: +

    +
      +
    • GSM - Global System for Mobile Communications
    • +
    • HSCSD - High-Speed Circuit-Switched Data
    • +
    • GPRS - Generic Packet Radio Service
    • +
    • EDGE - Enhanced Data rates for GSM Evolution
    • +
    • UMTS - Universal Mobile Telecommunications System
    • +
    • HSPDA - High-Speed Downlink Packet Access
    • +
    • Full (default) - Transfer data as quickly as your computer allows.
    • +
    +
    Network: Latency (Advanced)Select a network protocol to set how much time (delay) it takes for the + protocol to transfer a data packet from one point to another point.
    hw.camera
    Emulated Performance: Graphics

    Select how graphics are rendered in the emulator:

    +
      +
    • Hardware - Use your computer graphics card for faster rendering.
    • +
    • Software - Emulate the graphics in software, which is useful if you're + having a problem with rendering in your graphics card.
    • +
    • Auto - Let the emulator decide the best option based on your graphics + card.
    • +
    Multi-Core CPU (Advanced)Select the number of processor cores on your computer that you’d like + to use for the emulator. Using more processor cores speeds up the emulator. +
    Maximum horizontal camera pixels
    Memory and Storage: RAMThe amount of RAM on the device. This value is set by the hardware + manufacturer, but you can override it, if needed, such as for faster + emulator operation. Increasing the size uses more resources on your + computer. Type a RAM size and select the + units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or + TB (terabyte).
    Memory and Storage: VM HeapThe VM heap size. This value is set by the hardware + manufacturer, but you can override it, if needed. Type a heap size and + select the + units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or + TB (terabyte). For more information on Android VMs, see + Memory Management for + Different Virtual Machines.
    Memory and Storage: Internal StorageThe amount of nonremovable memory space available on the device. This + value is set by the hardware + manufacturer, but you can override it, if needed. Type a size and select the + units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or + TB (terabyte).
    Memory and Storage: SD CardThe amount of removable memory space available to store data on the + device. To use a virtual SD card managed by Android Studio, select + Studio, type a size, and select the + units, one of B (byte), KB (kilobyte), MB (megabyte), GB (gigabyte), or + TB (terabyte). A minimum of 100 MB is recommended to use the camera. To + manage the space in a file, select External File and + click ... to specify the file and location. For more + information, see mksdcard. +
    Default value is "640".hw.camera.maxHorizontalPixels
    Maximum vertical camera pixelsDefault value is "480".hw.camera.maxVerticalPixels
    GPS supportWhether there is a GPS in the device. Default value is "yes".hw.gps
    Battery supportWhether the device can run on a battery. Default value is "yes".hw.battery
    AccelerometerWhether there is an accelerometer in the device. Default value is "yes".hw.accelerometer
    Audio recording supportWhether the device can record audio. Default value is "yes".hw.audioInput
    Audio playback supportWhether the device can play audio. Default value is "yes".hw.audioOutput
    SD Card supportWhether the device supports insertion/removal of virtual SD Cards. Default value is - "yes".hw.sdCard
    Cache partition supportWhether we use a /cache partition on the device. Default value is "yes".disk.cachePartition
    Cache partition sizeDefault value is "66MB".disk.cachePartition.size
    Abstracted LCD densitySets the generalized density characteristic used by the AVD's screen. Default value is - "160".hw.lcd.density
    + + Device Frame: Enable Device Frame + Select to enable a frame around the emulator window that mimics the + look of a real device. + + + Custom Skin Definition (Advanced) + Select a skin that controls what the device looks like when displayed in + the emulator. Remember that specifying a screen size that's too small for + the resolution can mean that the screen is cut off, so you can't see the + whole screen. See + Creating Emulator Skins + for more information. + + + Keyboard: Enable Keyboard Input (Advanced) + Select this option if you want to use your hardware keyboard to interact + with the emulator. It's disabled for Android Wear and Android TV. + +

    Creating Emulator Skins

    -

    An Android emulator skin is a collection of files that define the visual and control elements of -an emulator display. If the skin definitions available in the AVD settings don't meet your needs, -you can create your own custom skin definition, then apply it to your AVD from the -advanced settings on the Verify Configuration screen.

    +

    An Android emulator skin is a collection of files that define the visual +and control elements of +an emulator display. If the skin definitions available in the AVD settings +don't meet your requirements, +you can create your own custom skin definition, and then apply it to your AVD. +

    Each emulator skin contains:

    To create and use a custom skin:

      -
    1. Create a new directory where you will save your skin configuration files.
    2. +
    3. Create a new directory where you will save your skin configuration + files.
    4. Define the visual appearance of the skin in a text file named - layout. This file defines many characteristics of the skin, such as the + layout. This file defines many characteristics of the skin, + such as the size and image assets for specific buttons. For example:
       parts {
      @@ -322,14 +705,16 @@ parts {
       
    5. Add the bitmap files of the device images in the same directory.
    6. -
    7. Specify additional hardware-specific device configurations an hardware.ini +
    8. Specify additional hardware-specific device configurations in a + hardware.ini file for the device settings, such as hw.keyboard and hw.lcd.density.
    9. -
    10. Archive the files in the skin folder and select the archive file as a custom skin.
    11. +
    12. Archive the files in the skin folder and select the archive file as a + custom skin.

    For more detailed information about creating emulator skins, see the -Android Emulator Skin File Specification in the tools source code.