Saturday, January 8, 2022

How to create an Android Virtual Device (AVD) with ease?


As we know, an Android Virtual Device (AVD) is a configuration that defines the characteristics of an Android phone, tablet, Wear OS, Android TV, or Automotive OS device that you want to simulate in the Android Emulator


The AVD Manager is an interface you can launch from Android Studio that helps you create and manage AVDs.



So, how to create an AVD? And then how to run an emulator that uses the AVD?


1. Open the AVD Manager by clicking 'Tools > AVD Manager' from the Android Studio.


2. Click 'Create Virtual Device', at the bottom of the AVD Manager dialog.

    The 'Select Hardware' page then appears.


3. Notice that only some hardware profiles are indicated to include Play Store

    Pay attention to those hardware profiles labeled with the Google Play logo in the Play Store column. This indicates that these profiles are fully CTS compliant and may use system images that include the Play Store app.


4. Select a hardware profile, and then click 'Next'.

    Here we select 'Phone' - 'Pixel 2, 5.0", 1080x1920, 420dpi'.


5. The 'System Image' page now appears.


A system image labeled with Google APIs includes access to Google Play services. A system image labeled with Google Play includes the Google Play Store app and access to Google Play services, including a Google Play tab in the Extended controls dialog that provides a convenient button for updating Google Play services on the device.


Select the system image for a particular API level, and then click 'Next'.


Here we select the system image 'Q, API Level = 29, ABI = x86, Target = Android 10.0 (Google Play)'.


6. The 'Verify Configuration' page appears.

    Here we enter the AVD Name: Pixel 2 API 29(Android 10).


7. In the 'Your Virtual Devices' page, now we can find the AVD that we just created.

To run an emulator that uses the AVD, from the 'Your Virtual Devices' page, just double-click that AVD, or click Launch button for it.


Several minutes later, an emulator that you want will be up and running. 😎




Reference to the official Android Developer Website -