gpt4 book ai didi

android - 如何从android测试发送触摸事件?

转载 作者:太空宇宙 更新时间:2023-11-03 13:34:38 26 4
gpt4 key购买 nike

documentation 中说明那个

Android test case classes for activities extend JUnit and also connect you to the application under test with instrumentation. You can send keystroke or touch events directly to the UI.

我没有找到关于如何发送触摸事件的描述,请指教。

最佳答案

TouchUtils 上使用各种方法类(class)。引用 JavaDocs:

Reusable methods for generating touch events. These methods can be used with InstrumentationTestCase or ActivityInstrumentationTestCase2 to simulate user interaction with the application through a touch screen.

关于android - 如何从android测试发送触摸事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8821344/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com