iOS simulator - disable connect hardware keyboard programmatically

泪湿孤枕 提交于 2019-12-10 10:19:31

问题


I'm writing UITests that rely on showing the software keyboard. Since the CI launches the tests every time on clean new simulator, the simulator has hardware keyboard connected, hence the software one is not being presented.

Is it possible to set some settings (maybe in schema?) to force-disable connecting hardware keyboard by the simulator.

I am running tests using cucumber/appium.


回答1:


Actually we faced the issue , the only solution we come up with is to perform "osascript" to run on your code right after the simulator starts .

osascript : basically will check the HW keyboard and if its enabled it will disabled it.




回答2:


Has anyone figured out how to do this supporting Xcode 10? Using defaults write com.apple.iphonesimulator ConnectHardwareKeyboard -bool false doesn't work.



来源:https://stackoverflow.com/questions/54327556/ios-simulator-disable-connect-hardware-keyboard-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!