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

Viewed 55982

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?

12 Answers

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/.*(//'
Related