PC keyboard not working in Android emulator [duplicate] - android-emulator

This question already has answers here:
Android emulator doesn't take keyboard input - SDK tools rev 20
(13 answers)
Closed 5 years ago.
I'm unable to use my PC keyboard to input characters into the app running on AVD emulator even though I had chosen 'Enable keyboard input' when creating the AVD. Can anyone help?
Below is my config.ini.
Note
File directory can be accessed from AVD Manager:
-> click the down arrow on the Actions column
-> Show on Disk.
For GNU/Linux users, with default Android Studio configuration, the
file is found under directory
/home/<<user>>/.android/avd/<<device>>.avd
config.ini
avd.ini.encoding=UTF-8
AvdId=Nexus_5_API_21
abi.type=x86_64
avd.ini.displayname=Nexus 5 API 21
disk.dataPartition.size=200M
hw.accelerometer=yes
hw.audioInput=yes
hw.battery=yes
hw.camera.back=none
hw.camera.front=none
hw.cpu.arch=x86_64
hw.dPad=no
hw.device.hash2=MD5:2fa0e16c8cceb7d385183284107c0c88
hw.device.manufacturer=Google
hw.device.name=Nexus 5
hw.gps=yes
hw.gpu.enabled=yes
hw.keyboard=yes
hw.lcd.density=480
hw.mainKeys=no
hw.ramSize=1536
hw.sdCard=yes
hw.sensors.orientation=yes
hw.sensors.proximity=yes
hw.trackBall=no
image.sysdir.1=system-images/android-21/default/x86_64/
runtime.network.latency=none
runtime.network.speed=full
runtime.scalefactor=0.25
sdcard.path=/Users/xxxxxx/.android/avd/Nexus_5_API_21.avd/sdcard.img
skin.dynamic=yes
skin.name=nexus_5
skin.path=/Applications/Android Studio.app/Contents/plugins/android/lib/device-art-resources/nexus_5
snapshot.present=no
tag.display=Default
tag.id=default
vm.heapSize=64
More info:
I'm using Mac OS X 10.10.4 (Yosemite).
Android Studio 1.3

I had this issue despite having the correct configuration, and realized that the actual problem was that the focus was on the emulator control buttons windows, as reported in this issue.
To check if this is your problem, see if pressing space actually presses one of those buttons, and if pressing tab moves the highlight focus square between elements in the emulator controls. If that is the problem, then you should be able to work around it as follows:
Select the extended controls (The "..." button in the emulator controls)
Change to any item in the extended controls window by clicking
Close the extended controls window
The focus should now return to the main Android emulator window, not the emulator controls, and key presses should go to Android apps.

try to change following.
hw.keyboard = yes
hw.keyboard.lid = no
hw.keyboard.charmap = qwerty2

Related

Highlighting code with mouse goes wild in Visual Studio Code

When I try to highlight some code in Visual Studio code it goes crazy and moves very fast. E.g. I want to select around one page and end up selecting 10 "pages" worth of code.
How can I make it act normaly when I want to highlight some code?
I used to have the same issue. A weird behavior with mouse selection. This was my solution path.
Check for hardware failures.
Unplug the keyboard dongle. If suddenly the mouse selection goes well. Do this steps.
Check for keys stucked βœ…
Uninstall the keyboard driver from Device Manager βœ…
Change the dongle USB port βœ…
And after all this steps, my cursor comes back to normality... for a while 😐.
Made the keyboard check with keyboard tester
Detect the key with the failure (Fortunately Insert in my case).
Download the app keytweak and disable that key.
This is a workaround if you don´t want to buy a new keyboard. I hope your failing key isn't any vocal 😬. If so... buy a new one.

iOS simulator is not lisiting in visual studio 2019

enter image description here
iOS-simulator is not listed all the time. sometime its showing most of the time its not there. not doing any specific changes in my machine. Simply when i restart VS app. its missing.
tried unload & reload the ios project. still the same.
complete reinstall visual studio & xcode from scratch.
tried update xcode.
Nothing helped from above suggestions.
Would be really great help if someone could help me with this issue.
I've encountered the same problem several times and here are some of my suggestions:
Did you try switching to your Android project then switch back to iOS project? This should be the simplest way
In your iOS project options, create a build configuration specifically dedicated to iOS Simulators only. Make sure to set Linker behavior to Don't Link
Quit Xcode and Visual Studio first. Open Finder, press Command + Shift + G, paste the following path: Users/YourUserNameHere/Library/Developer/Devices/ You'll see a bunch of folders with encoded folder names and a file device_set.plist
Next delete all the folders in Devices directory, then open device_set.plist by double clicking it. This should open it in Xcode. You'll see a bunch of key-value pairs under DefaultDevices and DevicePairs, click on the arrow on the left side and delete of the devices listed there by hovering the mouse over a category and click the minus (-) button next to it.
Press Command + Shift + 2 to open Devices & Simulators Window (Alternatively you can choose on menu Window -> Devices and Simulators. Choose Simulators on the left sidebar. Delete all the simulators if there's still any of them showing up. Then create several simulators, ones that you really need for debugging your app. Quit Xcode, reboot the machine, open Visual Studio again.

Run Simulators docked in VSCode

Is it possible to run iOS or Android simulator docked inside VSCode (or is there a feature request or extension to do so)? ideally as one of the tabs in the panel, where the Terminal is.
UPDATE:
the best workaround solution I could come up with is dragging the ios simulator on a native macos space, as seen in picture. this is not doable on windows or linux afaik

Swift - Soft keyboard won't appear OR Hardware keyboard won't work

I am trying to make the soft keyboard appear on my iOS simulator. For some reason it just won't show.
I keep getting this error as I select the TextField
Can't find keyplane that supports type 5 for keyboard iPhone-PortraitTruffle-PhonePad; using
I have tried to enabling / disable Hardware->Keyboard->Connect Hardware Keyboard as some SO answers recommended.
EDIT
Previously, the Connect Hardware Keyboard was enabled, I was able to type on my mac keyboard, also the soft keyboard poped up. For some reason after I disable the Connect Hardware Keyboard option, I cannot type on my mac keyboard anymore.
Make sure iOS Simulator -> Hardware -> Keyboard -> Connect Hardware Keyboard is not checked if you aren't using a hardware keyboard.
Go to Simulator-> Hardware->Keyboard and uncheck Connect Hardware Keyboard. It will work
This problem seems to be there in many devices https://bugreport.apple.com/logon Post a bug.. Hope apple will fix this bug
I found a similar problem in this thread.
Though most of the answers trying to fix it with Connect Hardware Keyboard, one of them is referring to sizing the views.
Another good point was mentioned in this answer:
The emulator tries to find a numeric keypad on the mac, but this is not found (MacBook Pro, MacBook Air and "normal/small" keyboard do not have it). You can deselect the option Connect Hardware Keyboard or just ignore the error message, it will have no negative effect on application.
And one more solution:
iOS Simulator-> Hardware-> Keyboard -> iOS uses same layout as OS X
Hope this helps.
For me, this appears only to be a problem in the latest version of Xcode (and tools). The quickest and most robust solution I've found is to simply restart the Simulator.
I expect this is a bug and will be fixed in a later release.

How do I type using my keyboard on the iphone simulator?

I used to be able to type with my real mac keyboard after launching the iPhone Simulator. Typing with the on-screen simulator keyboard is just horrible when testing with large amounts of text.
No matter what I do, I can't get my keyboard to type anymore inside the simulator. Even if I have "Simulate Hardware Keyboard" switched ON, it just won't type anything. Can someone please tell me what I'm doing wrong? Is there no way to type using the real keyboard anymore?
Try trashing the iPhone Simulator preferences file. When my iPhone Simulator stopped responding to keystrokes, this fixed it.
Quit the simulator.
Go to finder and press (command+shift+G) then navigate ~/Library/Preferences.
Move com.apple.iphonesimulator.plist to the trash.
Try launching your iPhone app in the simulator again.
Deleting com.apple.iphonesimulator.plist did not help me under Xcode 6.0.1.
Probably, it worked in old Xcode.
But, what works perfectly for me under Xcode 6.0.1, it is new hot Keys in iOS Simulator:
Shift-Command-K Connect/Disconnect Hardware Keyboard
Command-K Toggle (Show/Hide) Software Keyboard
And, you know, I really suffered for last 2 months, until found it, and it is very convenient now))
Don't trash the iPhone simulator preference files. There's no need to do this.
Look in the simulator's menu Hardware βž” Keyboard. The menu options are:
iOS Uses Same Layout as OS X
Connect Hardware Keyboard β‡§βŒ˜K
Toggle Software Keyboard ⌘K
Ensure option 2 is checked.
If it's already checked, uncheck it then check it again (you'll probably want to learn the keyboard shortcuts).
If you find that this hides the on screen keyboard, but you also want this to show, use option 3 to toggle it back on.
If rotating the simulator seems to stop the keyboard working, toggle option two off then back on – this seems to resolve it.
I am using iOS Simulator Version 7.0. While the simulator was running I went to iOS Simulator->Reset Contents and Settings... and reset the simulator from there. That seemed to have done the trick for me. Hope that helps.
This is because you have used changing the orientation of simulator using keyboard shortcuts. Just press cmd on the mac keyboard then start typing.
All I needed to do was quit the simulator and launch it again
MY PROBLEM WAS KEYBOARD IS SHOWING AND KEYSTROKES NOT DETECTING. AND I FOUND THE SOLUTION:
You don't need to quit the keyboard.
Try Hardware->Keyboard->Connect Hardware Keyboard directly
Removing com.apple.iphonesimulator.plist worked for me too, but I had to locate it inside the hidden folder /Users/[yourusername]/Library/Preferences/
Shell / Command-Line / Jenkins / CI:
sh "plutil -replace DevicePreferences.${deviceID}.ConnectHardwareKeyboard -bool NO $HOME/Library/Preferences/com.apple.iphonesimulator.plist"
sh "plutil -extract DevicePreferences.${deviceID} xml1 -o - $HOME/Library/Preferences/com.apple.iphonesimulator.plist"
The Device ID can be found via xcrun / simctl, based on the devoce name:
xcrun simctl list | grep ${simulatorDeviceName} | sed 's/).*(.*//;s/.*(//'
I encountered the same problem and tried a lot of different ways which worked mostly but never for sure. Ultimately, I found this. https://stackoverflow.com/a/26057011/1463604
If you are developing a React Native app and you cannot refresh (⌘R) or enable remote debugging (⌘D) from the iOS simulator, while other keyboard inputs work, make sure you are running a debug build configuration. You can check this with:
Product -> Scheme -> Edit Scheme -> Run -> Info -> Build Configuration -> Debug"
I got this tip from here.
Just restart Simulator (close and open the app).