问题描述
我正在尝试使用Monkeyrunner模拟复杂的触摸事件.用...从a滑动到b
I am trying to use monkeyrunner to simulate complex touch events.A swipe from a to b with...
device.drag((300,500),(300,650),0.5,50)
效果很好,但尝试从a到b到c进行复杂的移动不起作用
works great but a complex movement from a to b to c doesn't work trying with that
device.touch(100,500, 'DOWN')
device.touch(300,500, 'MOVE')
device.touch(300,400, 'MOVE')
device.touch(300,400, 'UP')
寻找解决方案,然后找到了.. https://android-review.googlesource.com/#/c/50991/
Was seaching for a solution and found this..https://android-review.googlesource.com/#/c/50991/
这已经在正式的android sdk中实现了吗?还是我必须编译它或其他东西以及它如何工作?
Is this already implemenet in the offical android sdk?or did i have to compile it or something else and how it works?
我真的不知道,但是我认为这是monkeyrunner的官方消息. MonkeyDevice .java ,并且该行在第70行具有"MOVE"类型.但是第28行同一侧的TouchAction.java没有实现"MOVE".所以也许这就是它不起作用的原因.
I dont really know but i think this side is the official monkeyrunner source..MonkeyDevice.java and this one have the "MOVE" type on line 70.But the TouchAction.java on same side at line 28 have no "MOVE" implemented.So maybe that's the reason why it's not working.
有人可以告诉我如何在Android手机上进行复杂的触摸运动吗?
Can somebody tell me how i get complex touch movement on android phone?
推荐答案
是的,它现在已合并到官方的SDK工具中.您可以使用它.只需要担心MOVE和MOVE之间的延迟.
Yes, it merged to official SDK tools now.You can use it.Just care about delay between MOVE and MOVE.
这是一个链接为您提供示例代码.我已经在我的Galaxy Nexus上测试了代码.
Here is a link to sample code for you.I have tested the code on my Galaxy Nexus.
这篇关于Android猴子赛跑者:通过MOVE触摸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!