android drag and drop shell command

What I want is to scroll the screen PRECISELY from command line.
For example, scroll up 100 pixels.
There is input shell command that can do tap and swipe.
However, the input swipe 500 500 500 400 command scroll the screen more than 100 pixels.
Maybe I can add long duration (10s) to make it more close.

input swipe 500 500 500 400 10000

But I am thinking more smart way.

I could do that in monkeyrunner as below

mdevice().touch(int(t1.x),int(t1.y),MonkeyDevice.DOWN)
sleep(0.1)
mdevice().touch(int(t2.x),int(t2.y),MonkeyDevice.MOVE)
sleep(1.1)
mdevice().touch(int(t2.x),int(t2.y),MonkeyDevice.UP)

If independent commands for down, move and up provided, I am thinking that it could be done.

Is there any method?


Source: shell

Leave a Reply