Android virtual Device(AVD)-build and run program using Emulator
An AVD contains a hardware profile, system image, storage area, skin, and other properties.
The AVD Manager lets you manage your AVDs all in one place.
To run the AVD Manager, do any one of the following:
In Android Studio, select Tools > Android > AVD Manager.
Click AVD Manager in the toolbar.
The AVD Manager appears.
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:
Define a new AVD
Edit an existing AVD
Delete an AVD
Import or export hardware profile definitions.
Run an AVD to start the emulator.
Stop an emulator.
Clear data and start fresh, from the same state as when you first ran the emulator.
Show the associated AVD .ini and .img files on disk.
View AVD configuration details that you can include in any bug reports to the Android Studio .
Creating an AVD
1) You can create a new AVD from the beginning, or
2) duplicate an AVD and change some properties.
To create a new AVD: From the Your Virtual Devices page of the AVD Manager, click Create Virtual Device. Alternatively, run your app from within Android Studio. In the Select Deployment Target dialog, click Create New Emulator. The Select Hardware page appears.
From this page you can:
Define a new AVD
Edit an existing AVD
Delete an AVD
Import or export hardware profile definitions.
Run an AVD to start the emulator.
Stop an emulator.
Clear data and start fresh, from the same state as when you first ran the emulator.
Show the associated AVD .ini and .img files on disk.
View AVD configuration details that you can include in any bug reports to the Android Studio .
Creating an AVD
1) You can create a new AVD from the beginning, or
2) duplicate an AVD and change some properties.
To create a new AVD: From the Your Virtual Devices page of the AVD Manager, click Create Virtual Device. Alternatively, run your app from within Android Studio. In the Select Deployment Target dialog, click Create New Emulator. The Select Hardware page appears.
- Select a hardware profile, and then click Next. If you don't see the hardware profile you want, you can create or import a hardware profile. The System Image page appears.
- Select the system image for a particular API level, and then click Next.
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 API level of the target device is important, because your app won't be able to run on a system image with an API level that's less than that required by your app, as specified in the minSdkVersion attribute of the app manifest file. For more information about the relationship between system API level and minSdkVersion, see Versioning Your Apps.
If your app declares aelement in the manifest file, the app requires a system image in which that external library is present. If you want to run your app on an emulator, create an AVD that includes the required library. To do so, you might need to use an add-on component for the AVD platform; for example, the Google APIs add-on contains the Google Maps library.
The Verify Configuration page appears. - Change AVD properties as needed, and then click Finish.Click Show Advanced Settings to show more settings, such as the skin.
The new AVD appears in the Your Virtual Devices page or the Select Deployment Target dialog.
To create an AVD starting with a copy:
- From the Your Virtual Devices page of the AVD Manager, right-click an AVD and select Duplicate.
- Click Change or Previous if you need to make changes on the System Image and Select Hardware pages.
- Make your changes, and then click Finish.
Or click Menu and select Duplicate.
The Verify Configuration page appears.
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:
- In the Select Hardware page, click New Hardware Profile.
- In the Configure Hardware Profile page, change the hardware profile properties as needed.
- Click Finish.
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:
- In the Select Hardware page, select a hardware profile and click Clone Device.
- In the Configure Hardware Profile page, change the hardware profile properties as needed.
- Click Finish.
Or right-click a hardware profile and select Clone.
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
From the Your Virtual Devices page, you can perform the following operations on an existing AVD:
- To edit an AVD, click Edit and make your changes.
- To delete an AVD, right-click an AVD and select Delete. Or click Menu and select Delete.
- To show the associated AVD
.ini
and.img
files on disk, right-click an AVD and select Show on Disk. Or click Menu and select Show on Disk. - To view AVD configuration details that you can include in any bug reports to the Android Studio team, right-click an AVD and select View Details. Or click Menu and select View Details.
Working with Existing Hardware Profiles
From the Select Hardware page, you can perform the following operations on an existing hardware profile:
- To edit a hardware profile, select it and click Edit Device. Or right-click a hardware profile and select Edit. Next, make your changes.
- 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:
- To run an emulator that uses an AVD, double-click the AVD. Or click Launch .
- To stop a running emulator, right-click an AVD and select Stop. Or click Menu and select Stop.
- To clear the data for an emulator, and return it to the same state as when it was first defined, right-click an AVD and select Wipe Data. Or click Menu and select Wipe Data.
note:
- if there is an error of downloading a hxam then download and install it first.
- if it ask to enable vt-x or virtual technology just go to your computers BIOS find the option and enable
save settings and exit the BIOS.
Comments
Post a Comment