Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Hardware Section" is missing under Android Virtual Device Manager

Tags:

android

avd

I was trying to fix my problem "hardware buttons not enabled in AVD" after an hour research all I found was people who lead people to go to "hardware section and fix blabla"

but interestingly my AVD doesn't have this section.I actually found some of options under Device Definitions but still couldnt fix my problem nor found this menu.All screenshots I saw had Hardware section...

My specs are; MacOS , Android 4.2.2 (Api17) , Eclipse

P.S:everything else works perfectly .I am just missing this section.

Here is a screenshot

like image 769
Anar Bayramov Avatar asked Jan 13 '13 17:01

Anar Bayramov


People also ask

Where is the AVD Manager in Android Studio?

To launch the AVD Manager: In Android Studio, select Tools > Android > AVD Manager, or click the AVD Manager icon in the toolbar.

What is the purpose of the Android Virtual Device Manager?

The avdmanager is a command line tool that allows you to create and manage Android Virtual Devices (AVDs) from the command line. An AVD lets you define the characteristics of an Android handset, Wear OS watch, or Android TV device that you want to simulate in the Android Emulator.


2 Answers

The instructions you were looking at were probably from R20 or earlier versions of the Android Developer Tools. R21 is different and appears to be what you are running. You change the behavior of the hardware buttons on the Device Definitions tab for whatever device is associated with your AVD:

Device Definitions

Change the Buttons drop-down to Software or Hardware depending on what you want the behavior to be.

like image 139
CommonsWare Avatar answered Oct 19 '22 08:10

CommonsWare


After lengthy trial and error, I banished the "hardware buttons not enabled in AVD" problem by discovering that there are at least three distinct 'gotchas' that must be set properly. I am using Eclipse Java EE Juno with ADT version 22.3.0 (latest as of 2013 Nov 3).

In summary, it's a bit awkward to figure out the first time, but simple thereafter. The virtual device definition must include 1) hardware buttons, 2) the device definition must also be chosen in the AVD selector drop down field, and 3) the box must be ticked for displaying a skin with hardware controls. All three are critical. Step by step:

  1. Window → Android Virtual Device Manager (See screen capture below) (NOTE: If not visible in menu, choose Window → Customize Perspective and tick Android SDK and AVD manager - but assume this has already been done if you have gotten far enough to get the above error message)

Android Virtual Device Manager first tab

  1. Click the first tab, which is Android Virtual Device, click Edit, and note the name of the Device listed in the second combo box field from the top. This is going to be either a built in default Android virtual device definition, or a custom one you have created (or will create) from scratch. Make note of this Device name and close Edit Android Virtual Device edit window by clicking "OK"

Android Virtual Device editing device

  1. Click the second tab in Android Virtual Device Manager which is Device Definitions and select the device you remember from step #2 above from the list (Note to emulator developers - this setup step is slightly more awkward than necessary - perhaps tabs one and two could be tied together more closely to allow double clicking a device and editing it directly instead of having to close a tab then opening another). After selecting the virtual device definition, choose Edit (or Clone if the device you want to edit is a built-in definition because if it is a built-in device, it must be saved as a cloned copy once edited. Name the cloned device something memorable in the top left field of the Clone Device window, e.g. add "_hardwareButtons" to the end of the default name).

Android Virtual Device Manager second tab

  1. IMPORTANT: Edit the cloned device: Ensure that Buttons → Hardware is chosen on the right hand side, fourth field down, of the Edit Device (or Clone Device) window (from step #3 above under Device Definitions tab). This is critically important or the Hardware buttons will not be active. This is the most likely root cause of the above error message. It's OK to leave Input as No Nav unless you want to use the virtual DPad. Click Edit Device (or Clone Device) at the bottom right of the window to save your changes.

Device editing

  1. IMPORTANT: Inside Android Virtual Device manager, click first tab again, which is Android virtual device. Select Edit and ensure that the newly edited, created, or cloned device is selected by name in the Device field drop down combo box (second from top) of the AVD. (see top two screen captures above). It is critically important that the proper device is chosen here, because creating a newly cloned device does not automatically update, or associate it with, your AVD (see my comments to emulator developers above).

  2. IMPORTANT: Also inside the same Android Virtual Device edit box, Make sure SkinDisplay a skin with hardware controls is ticked. This is also critically important or you will not see any hardware buttons at all. Click "OK" to close Edit window.

  3. For good measure (possibly unnecessary) I clicked Refresh in the first tab (Android Virtual Device) of AVD manager and looked to be sure that a green checkmark was in front of the AVD I just edited. If not, it's probably because the newly edited device is not yet connected with your AVD. Click Edit and again choose the proper newly edited device name. Click "OK" to close.

  4. In addition and optional for the truly paranoid, you can click Details under AVD first tab and expand the window to look at your device definition specifics. Make sure that skin.dynamic is yes, hw.keyboard: is no (unless want keyboard) and hw.mainKeys: is yes and hw.dPad: is no (unless want dPad) and, as always, ensure that you have the proper device name chosen.

Now you should have a perfectly viable AVD defined that you can use in the RUN → RUN CONFIGURATION Eclipse menu and it will not display the dreaded "hardware buttons not enabled in AVD" error message.

In Eclipse, RUN → RUN CONFIGURATION, choose your app name from the left hand side (and make sure it also appears under Android tab) and that the newly defined AVD is ticked under the Target tab and click RUN. (or CTRL+F11 after the first run of any new configuration).

Here are some screen captures from a tablet emulator as an example:

like image 40
Dell Anderson Avatar answered Oct 19 '22 08:10

Dell Anderson