banner



How To Install Virtual Device In Android Studio

In this document

  1. Creating an AVD
    1. Creating a device definition
    2. Hardware options
  2. Creating Emulator Skins

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

To launch the AVD Manager:

  • In Android Studio, select Tools > Android > AVD Manager, or click the AVD Manager icon in the toolbar.
  • Or, use the command line to navigate to your SDK's tools/ directory and execute:
    $ android avd

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

Figure 1. The AVD Managing director main screen shows your current virtual devices.

Note: If y'all launch the AVD Managing director from the command line, the UI is different than how information technology appears in Android Studio, every bit documented here. Almost of the aforementioned functionality is bachelor, but the command-line version of the AVD Manager is currently non documented.

Creating an AVD

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

To create an AVD based on an existing device definition:

  1. From the main screen (figure 1), click Create Virtual Device.
  2. In the Select Hardware window, select a device configuration, such equally Nexus 6, then click Next.

    Figure ii. The Select Hardware window.

  3. Select the desired system version for the AVD and click Side by side.
  4. Verify the configuration settings, then click Finish.

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

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

Creating a device definition

In instance the bachelor device definitions do non friction match the device blazon you lot'd like to emulate, yous tin create a custom device definition for your AVD:

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

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

  3. The following Configure Hardware Profile window (effigy 3) allows y'all to specify diverse configurations such as the screen size, retention options, input blazon, and sensors.

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

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

  4. Your custom device configuration is now bachelor in the listing of device definitions (shown afterward 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).

Hardware options

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

Characteristic Description Belongings
Device ram size The amount of physical RAM on the device, in megabytes. Default value is "96". hw.ramSize
Touch-screen support Whether there is a bear upon screen or not on the device. Default value is "aye". hw.touchScreen
Trackball support Whether there is a trackball on the device. Default value is "yes". hw.trackBall
Keyboard support Whether the device has a QWERTY keyboard. Default value is "yep". hw.keyboard
DPad support Whether the device has DPad keys. Default value is "yes". hw.dPad
GSM modem support Whether at that place is a GSM modem in the device. Default value is "aye". hw.gsmModem
Camera support Whether the device has a camera. Default value is "no". hw.photographic camera
Maximum horizontal camera pixels Default value is "640". hw.photographic camera.maxHorizontalPixels
Maximum vertical camera pixels Default value is "480". hw.camera.maxVerticalPixels
GPS back up Whether at that place is a GPS in the device. Default value is "yeah". hw.gps
Bombardment support Whether the device tin run on a battery. Default value is "yes". hw.battery
Accelerometer Whether there is an accelerometer in the device. Default value is "yes". hw.accelerometer
Audio recording support Whether the device can record audio. Default value is "yep". hw.audioInput
Sound playback support Whether the device can play audio. Default value is "yes". hw.audioOutput
SD Card support Whether the device supports insertion/removal of virtual SD Cards. Default value is "yeah". hw.sdCard
Cache partition support Whether nosotros use a /cache partition on the device. Default value is "yep". deejay.cachePartition
Cache partition size Default value is "66MB". deejay.cachePartition.size
Bathetic LCD density Sets the generalized density characteristic used by the AVD's screen. Default value is "160". hw.lcd.density

Creating Emulator Skins

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

Each emulator skin contains:

  • A hardware.ini file
  • Layout files for supported orientations (mural, portrait) and physical configuration
  • Image files for display elements, such as background, keys and buttons

To create and use a custom skin:

  1. Create a new directory where you will save your skin configuration files.
  2. Ascertain the visual appearance of the skin in a text file named layout. This file defines many characteristics of the peel, such as the size and prototype avails for specific buttons. For example:
    parts {     device {         display {             width   320             height  480             10       0             y       0         }     }      portrait {         background {             epitome background_port.png         }          buttons {             power {                 image  button_vertical.png                 x 1229                 y 616             }         }     }     ... }            
  3. Add the bitmap files of the device images in the same directory.
  4. Specify additional hardware-specific device configurations an hardware.ini file for the device settings, such as hw.keyboard and hw.lcd.density.
  5. Archive the files in the skin folder and select the archive file equally a custom skin.

For more than detailed data near creating emulator skins, meet the Android Emulator Skin File Specification in the tools source code.

Source: https://android-doc.github.io/tools/devices/managing-avds.html

Posted by: thomascountim.blogspot.com

0 Response to "How To Install Virtual Device In Android Studio"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel