Reputation: 23244
I'd like to send touch events to an android device as fast as possible using adb shell
I already figured out I could do it like this:
while true; do input tap 500 500; done;
But this only taps like once every second.
I want to do it faster, as fast as possible.
is there any way to do this using adb
?
Context:
There is this android game where tapping as fast as possible is one of the objectives. My thought was I could cheat this game by simulating the taps. Unfortunately the method I found is nowhere near as fast as I'd liked.
Upvotes: 3
Views: 3385
Reputation: 635
infinite loop
and replace 'DOWN_AND_UP'
to MonkeyRunner.DOWN_AND_UP
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
while True:
device.touch(500, 500, MonkeyRunner.DOWN_AND_UP)
Upvotes: 2
Reputation: 23244
I figured out a way to do it much faster. It doesn't use adb
but it uses monkeyrunner
, another tool that is also included in de Android SDK.
So I run monkeyrunner
and do this:
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()
for i in range(1, 10000):
device.touch(500, 500, 'DOWN_AND_UP')
Upvotes: 2