本文介绍了以编程方式模拟iPhone上的键盘事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有可能模拟键盘事件(例如按下和按下字符)并将其发送到iOS设备.基本上,我想模拟用户按下键盘上的键.

I was wondering if it would be possible to simulate keyboard events - like key down and key up characters - and send them to the iOS device. Basically, I want to simulate a user pressing a key on the keyboard.

推荐答案

看看"iOS的自动GUI测试",例如和

have a look at "Automated GUI testing for iOS", for example Automated testing for iPhone and How about UI automation testing for iOS app with instruments & Javascripts

您可能不希望使用完整的自动化测试解决方案,但可以通过这种方式来模拟键盘事件.

You might not want a full blown automated test solution, but that way you can simulate your keyboard events.

还提到了一个博客文章: http://alexvollmer .com/posts/2010/07/03/working-with-uiautomation/

There is also a blogpost mentioned: http://alexvollmer.com/posts/2010/07/03/working-with-uiautomation/

这篇关于以编程方式模拟iPhone上的键盘事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 09:24