Android monkey runner: Touch with MOVE

自作多情 提交于 2019-12-18 07:15:05

问题


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)

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')

Was seaching for a solution and found this.. https://android-review.googlesource.com/#/c/50991/

Is this already implemenet in the offical android sdk? or did i have to compile it or something else and how it works?

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.

Can somebody tell me how i get complex touch movement on android phone?


回答1:


Yes, it merged to official SDK tools now. You can use it. Just care about delay between MOVE and MOVE.

Here is a link to sample code for you. I have tested the code on my Galaxy Nexus.



来源:https://stackoverflow.com/questions/18161416/android-monkey-runner-touch-with-move

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