I'm not sure what changed but the physical keyboard from my computer no longer works for the emulator (running kitkat in Nexus 5, x86). When i look in AVD at the device's advanced settings, there's nothing for a hardware keyboard. Where is this setting?
In the advanced settings of a virtual device in Android Studio 1.0.2 AVD Manager, there is actually a checkbox that allows to enable keyboard input without editing the config.ini by hand.
Tools → Android → AVD Manager → pencil icon (shown in picture) → Show Advanced Settings (scroll to bottom) → Enable Keyboard Input
Find the emulator's configuration in your home directory:
//Located in:
~/.android/avd/<The_Device_Name>/config.ini
For example, on the Nexus 5 (created by Android Studio), it was:
~/.android/avd/Nexus5.avd/config.ini
Change the below setting to be:
hw.keyboard=yes
Open and Navigate to Tools → Android → AVD Manager → Edit -> pencil icon)
Click on Show Advanced settings and scroll down and you can see the option
Enable Keyboard input (example second image) Check that box and Click on Finish.
UPDATE:
Change hw.keyboard = yes.
And make the file config.ini Read-only:
1.Right-click on the file open its settings.
2.Make every options on the permissions tab into Read-only(refer screenshot)
Trust me this will work it happens because this file gets rewritten,when we lock it out the bug disappears.
Quick script to do it automatically. Make sure to rename the emulator name part:
sed -i '' "s/hw.keyboard = no/hw.keyboard = yes/" $ANDROID_HOME/avd/[EMULATOR_NAME]/config.ini
I have the latest Android Development Tools and SDK Tools (Revision 21.1) and cannot seem to enable the keyboard normally seen on the right side of the emulator. I also cannot seem to find the relevant settings inside the Edit Device dialog. Any help here?
You can also issue a command from the keyboard. http://developer.android.com/guide/developing/tools/emulator.html
And If you enter manual resolution in AVD it will not show keyboard just select any default resolution keyboard will start showing up
I mean I can't type from my laptop keyboard into android emulator anymore.
Virtual and on-screen keyboards are working fine.
I had the same problem after upgrading to Tools version 20. I had to Edit the AVD to add an option as follows:
From Eclipse, Go to AVD Mananger.
Select the particular AVD and click on Edit
Go to the Hardware section, click on New.
Select the Property Name : Keyboard Support
By default, it is added with a value of 'no'. Just click on the value column and change it to 'yes'.
Click on Edit AVD again.
This will add a property hw.keyboard=yes in config.ini file for the AVD. And it should work fine from there.
Recently upgraded my Android SDK install to r20 and now keyboard input seem to have stopped working with both existing and new AVDs.
Everything was working fine prior to the upgrade.
Does anyone know what would have caused this? (I'm using ubuntu 12.04 x64).
I solved this problem by adding "Keyboard Support" to the AVD within the AVD-Manager and changing the value to "true".
Turns out its a change in the default settings for the emulator in r20 of the Android SDK.
If you want to enable the keyboard for your android virtual device via command line, edit ~/.android/avd/[YOUR_AVD].avd/config.ini and add this to the file:
hw.keyboard=yes
Restart your AVD and you should be in business.
If you want to enable the keyboard for your android virtual device via command line, edit~/.android/avd/[YOUR_AVD].avd/config.ini and add this to the file:
hw.keyboard=yes
Restart your AVD and you should be in business.
Or, go to following path(in my case mukesh is user):
mukesh/.android/avd/[YOUR_AVD].avd/config.ini and add this line
hw.keyboard=yes
You can learn more about this from my blog Here
You need to add a property to your AVD to enable keyboard support.
In Eclipse go to Window > Android Virtual Device Manager
Select your AVD
Click Edit...
In the Hardware section click New..
Property: Keyboard Support
Click OK
Change the value for Keyboard Support to "yes"
Click Edit AVD
Select your AVD
Click Start...
I've upgraded the SDK tools to revision 20 (from 18) and since the upgrade, the emulator doesn't seem to accept input from laptop's keyboard. But only using the emulator's own 'soft' keyboard (that appears when an input field is focused).
I've tried reinstalling the SDK tools (and the whole SDK for that matter), uninstalled and reinstalled Eclipse Android plugins, re-created emulator devices. But none of that seem to help and its driving me mad. Its hopeless to key-in using a laptop's trackpad.
Has anyone encountered this problem?
Update
As of SDK rev 21 the Android Virtual Device Manager has an improved UI which resolves this issue. I have highlighted some of the more important configuration settings below:
If you notice that the soft (screen-based) main keys Back, Home, etc. are missing from your emulator you can set hw.mainKeys=no to enable them.
Original answer
Even though the developer documentation says keyboard support is enabled by default it doesn't seem to be that way in SDK rev 20. I explicitly enabled keyboard support in my emulator's config.ini file and that worked!
Add: hw.keyboard=yes
To: ~/.android/avd/<emulator-device-name>.avd/config.ini
Similarly, add hw.dPad=yes if you wish to use the arrow-keys to navigate the application list.
Reference: http://developer.android.com/tools/devices/managing-avds-cmdline.html#hardwareopts
On Mac OS and Linux you can edit all of your emulator configurations with one Terminal command:
for f in ~/.android/avd/*.avd/config.ini; do echo 'hw.keyboard=yes' >> "$f"; done
On a related note, if your tablet emulator is missing the BACK/HOME buttons, try selecting WXGA800 as the Built-in skin in the AVD editor:
Or by manually setting the skin in config.ini:
skin.name=WXGA800
skin.path=platforms/android-16/skins/WXGA800
(example is for API 16)
Confirmed. I had the same problem after upgrading to Tools version 20. I had to Edit the AVD to add an option as follows:
From Eclipse, Go to AVD Mananger.
Select the particular AVD and click on Edit
Go to the Hardware section, click on New.
Select the Property Name : Keyboard Support
By default, it is added with a value of 'no'. Just click on the value column and change it to 'yes'.
Click on Edit AVD again.
This will add a property hw.keyboard=yes in config.ini file for the AVD.
You also have to set hw.mainKeys = yes
In Android Studio, open AVD Manager (Tools > Android > AVD Manager).
Tap the Edit button of the emulator:
Select "Show Advanced Settings"
Check "Enable keyboard input"
Click Finish and start the emulator to enjoy the keyboard input.
Look in AVD Manager, select the AVD and click in Edit. In Hardware section: click in "New" and search for "Keyboard support" and add with OK button and set the value to "yes" and save changes with "Edit AVD"
Google wanted to give some more headache to the developers.
So, what you have to do now is edit your AVD and add "Keyboard Support" for it in the Hardware section and change the value to "Yes"
Add the following line
hw.keyboard=yes
to your AVD config file
~/.android/avd/<avd_folder>/config.ini
Restarting the emulator helps sometimes when typing is unavailable - despite keyboard input being enabled for your Android Virtual Device.
Just in case somebody finds it usefull.
I had a problem with the KEYCODE_DPAD_UP it belongs to the trackBall. to solve this change your avdfolder/config.ini hw.trackBall=yes and push DEL or F6
Here is some workaround that actually worked for me, it is the same solution as in the most popular answer - just
add hw.keyboard=yes to config.ini
but since this didn't work for me I additionally
renamed config.ini (any name will do) to something like consssssfig.ini
restarted emulator (obviously it didn't start)
renamed config.ini back again
(I am not sure if relevant) I added this new parameter (hw.keyboard=yes) at the beggining of config.ini file
Sometimes computer keyboard stops working on android emulator. Today I've noticed, that after pushing this button (that I marked with red arrow), keyboard starts working again (seems to be some issues with emulator window focus)
Look for the hidden .android folder in your user home folder. You might rename or delete this folder, recreate your AVD, and restart the emulator. It could be there is a .ini file in that folder that has that setting munged.
Recreating an AVD with the Hardware Keyboard + setting the boolean to true was the only solution that worked for me; the other two main solutions (terminal or editing an existing AVD via GUI) both resulted in software/emulator crashes on my Mac. Making a new AVD resulted in the keyboard working just fine.
I have used an emulator for API Level 23, which does not take keyboard input for installed apk.
So I have created new emulator for API Level 29, and then it works.
Following is the step to install new emulator.
Open "Android Virtual Device Manager"
Create new Virtual Device.
When you select a system image, please choose and download the last version(API Level29) on "Virtual Device Configuration" window