What is the AVD in Android?

Stay organized with collections Save and categorize content based on your preferences.

You can use Android Emulator to create emulations of Android devices that run your own custom Android system images. You can also share your custom Android system images so that other people can run emulations of them. In addition, you can add multi-display support to Android Emulator emulations.

Android Emulator architecture

Android Emulator allows you to run emulations of Android devices on Windows, macOS or Linux machines. The Android Emulator runs the Android operating system in a virtual machine called an Android Virtual Device (AVD). The AVD contains the full Android software stack, and it runs as if it were on a physical device. Figure 1 is a diagram of the Android Emulator's high-level architecture. For more information about the emulator, see Run apps on the Android Emulator.

What is the AVD in Android?

Figure 1. Android Emulator architecture

Building AVD images

Each AVD includes an Android system image, which runs in that AVD. The AVD Manager includes some system images. And you can build custom AVD system images from your source code and create device emulations to run them.

To build and run an AVD system image:

  1. Download the Android source:

    mkdir aosp-master; cd aosp-master
    repo init -u
    repo sync -j24
    

    If you want to build other Android versions, you can find their branch names in the public Android repository. They map to Android Codenames, Tags, and Build Numbers.

  2. Build an AVD system image. This is the same process as building an Android device system image. For example, to build a x86 32-bit AVD:

    mkdir aosp-master; cd aosp-master
    source ./build/envsetup.sh
    lunch sdk_phone_x86
    make -j32
    

    If you prefer to build an x86 64-bit AVD, run lunch for the 64-bit target:

    lunch sdk_phone_x86_64
    
  3. Run the AVD system image in the Android Emulator:

    emulator
    

See the Command-line startup options for more details about running the emulator. Figure 2 shows an example of the Android Emulator running an AVD.

What is the AVD in Android?

Figure 2. Android Emulator running an AVD

Sharing AVD system images for others to use with Android Studio

Follow these instructions to share your AVD system images with others. They can use your AVD system images with Android Studio to develop and test apps.

  1. Make additional sdk and sdk_repo packages:

    $ make -j32 sdk sdk_repo
    

    This creates two files under aosp-master/out/host/linux-x86/sdk/sdk_phone_x86:

    • sdk-repo-linux-system-images-eng.[username].zip
    • repo-sys-img.xml
  2. Host the file sdk-repo-linux-system-images-eng.[username].zip somewhere accessible to your users, and get its URL to use as the AVD System Image URL.

  3. Edit repo-sys-img.xml accordingly:

    • Update <sdk:url> to your AVD System Image URL.
    • See sdk-sys-img-03.xsd to learn about other updates to the file.
  4. Host repo-sys-img.xml somewhere accessible to your users, and get its URL to use as the Custom Update Site URL.

To use a custom AVD image, do the following in the SDK Manager:

  1. Add the Custom Update Site URL as an SDK Update Site.

    This adds your custom AVD system image to the System Images page.

  2. Create an AVD by downloading and selecting the custom AVD system image.

Adding Multi-Display support

Android 10 enhances Multi-Display (MD) to better support more use cases, such as auto and desktop mode. Android Emulator also supports multi-display emulation. So you can create a specific multi-display environment without setting up the real hardware.

You can add multi-display support to an AVD by making the following changes, or by cherry picking from these CLs.

  • Add multi-display provider to the build by adding these lines to file build/target/product/sdk_phone_x86.mk:

    PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \
        system/lib/libemulator_multidisplay_jni.so \
        system/lib64/libemulator_multidisplay_jni.so \
        system/priv-app/MultiDisplayProvider/MultiDisplayProvider.apk \
    PRODUCT_PACKAGES += MultiDisplayProvider
    
  • Enable the Multi-Display feature flag by adding this line to file device/generic/goldfish/data/etc/advancedFeatures.ini:

    MultiDisplay = on
    

You can find the latest emulator features and release information from the following sources:

  • Android Emulator User Guide
  • Android Emulator Release Notes

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2022-10-11 UTC.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }] [{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]

What is the purpose of an AVD?

Android Device Manager on Windows Each AVD is an emulator configuration that simulates a physical Android device. This makes it possible to run and test your app in a variety of configurations that simulate different physical Android devices.

What is difference between AVD and emulator?

Android Emulator allows you to run emulations of Android devices on Windows, macOS or Linux machines. The Android Emulator runs the Android operating system in a virtual machine called an Android Virtual Device (AVD). The AVD contains the full Android software stack, and it runs as if it were on a physical device.

What is AVD and SDK?

The former is called SDK Manager, which integrates easy updates for the Software Development Kit (SDK), including tools, platforms, and other components into packages. The latter is AVD Manager, which allows you to create and manage Android Virtual Devices (AVDs). AVDs are basically device emulators.

How to create AVD in Android?

Follow the below steps to install Android Virtual Device..
Step 1: Go to Tools > AVD Manager..
Step 2: Now click on Create Virtual Device..
Step 3: A pop-up window will be there and here we select the category Phone because we are creating android app for mobile and select the model of mobile phone we want to install..