如何在Android设备上模拟触摸事件? [英] How to simulate touch events on Android device?

查看:129
本文介绍了如何在Android设备上模拟触摸事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android API是否公开了用于生成触摸事件的功能,例如,反复模拟屏幕上的不同手势以进行测试?

Does the Android API expose facilities for generating touch events, for example, repeatedly simulating different gestures on the screen for testing?

推荐答案

您可以编写Android工具测试以在android中实现UI自动测试,请参见

You can write an Android Instrumention Test to implement UI auto testing in android, see Tesing UI for a Single Activity and Android Testing Support Library.

如果您不熟悉Android测试,建议您阅读活动测试首先.

If you are new to Android Test, I suggest you read Activity Testing first.

这篇关于如何在Android设备上模拟触摸事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆