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

后端 未结 12 848
太阳男子
太阳男子 2020-12-22 17:21

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 lar

12条回答
  •  悲&欢浪女
    2020-12-22 17:47

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

提交回复
热议问题