As discussed in the previous chapter of How to Create an Android Virtual Device using Android Emulator that theAndroid Emulator is not a real device but a replica of the android device simulating the android system. This can be configured differently for simulating different android devices. With the help of AVD configuration, Android Emulator can simulate:
- Different Target platforms Versions
- Different Screen sizes
- Different Resolutions
- Different input methods
- Different Hardware configurations
- Different external storage sizes for SD card
Although there are a good number of defaults device configurations are present in AVD Manager but still if you have any particular device in mind that you want to emulate you need to create an AVD that resembles the features of your target device. For example, you need to know the screen size and resolution and so on. In this chapter we will understand the importance of Device Definition and learn How to Create Default Device Definition and Creating Custom Device Definition Using AVD Manager.
Creating Default Device Definition
It is an easy task to create an Android virtual device (AVD) from the default device configurations available under Device Definitions tab. If you go into the AVD manager, you’ll see a list of preset devices in Device Definitions. These cover a variety of Google products and some generic devices.
1) To get started, first go to Device Definitions tab and select one of these presets and click ‘Create AVD’.
2) Every default device will provide you some preset AVD and that can be changed according to your need.
Note: Notice that the OK button is disabled, just because under CPU/ABI it says that “No system Images installed for this target“. To avoid this, select different Device configuration from Device & select any skin or select none for skin and proceed.
Below are the list of optional and mandatory settings:
- AVD NAME: Choose a name for the AVD like NexusSix-4.4 that refer to your device configuration
- Device: Select the AVD resolution as per the device options
- Target: Select the Android version / Test Environment or Target Platform
- CPU/ABI: Select Intel Atom (x86) for 32-bit and ARM (armeabi-v7) for 64-bit.
- Keyboard: Select this box to use the keyboard in the AVD
- Skin: Select this box to get the hardware buttons
- Front Camera: If the system have a webcam, that can be used with AVD
- Back Camera: If the system have a webcam, that can be used with AVD
- Memory Options: Set RAM & VM Heap for the device according to your need
- Internal Storage: Set this as per your need and Select GiB/MiB from the drop down
- SD Card: Set this as per your need and Select GiB/MiB from the drop down
- Emulation Options
- Snapshot: Select this to persist, it lets you quickly start the emulator after the first startup.
- Use Host GPU: Select this to use the computers graphics
3) After you complete above steps, the emulator will be displayed under the Android Virtual Devices tab, configured on the AVD Manager. Now Select the newly added AVD name and click on Start on the right.
4) This would launch the pop up with few options, you may choose as you want. Once done click on Launch, this will launch the emulator.
- Scale display to real size: This causes the resolution of the emulator’s display to be scaled to match the screen size
- Wipe user data: This would wipe any previous app installation you have done and would launch a plain fresh emulator. Wipe user data
- Launch from snapshot: This cause the emulated device to be started from a previously saved snapshot of the device’s state. The emulator launches much faster when launched from a snapshot
- Save to snapshot: This causes the emulated device’s state to be saved to a snapshot upon device exit
Once done, Emulator will launch, it would take few minutes to display the Home Screen of the virtual android device.
Creating a Custom Device Definition
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. If the AVD manager is opened, go to Device Definitions.
1) Click on Create Devices.
2) The following Configure Hardware Profile window will display and it allows you to specify various configurations such as the screen size, memory options, input type, and sensors.
Note: Once all the information is filled properly, Create Device button will get enabled and you may proceed then.
3) After you complete above steps, the emulator will be displayed under the Device Definition tab, configured on the AVD Manager. Now Select the newly created AVD name and click on Create AVD on the right.
Hardware options
If you are creating a new AVD, you can specify the following hardware options for the AVD to emulate:
Comments
Post a Comment