Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top