Faster alternative to `input`? I'm trying to automate a task on my (non-rooted) Android phone.
While I have it &quot;working&quot; using input, it is quite slow due to taking ~0.7s per event. (Basically, I just need to send a bunch of tap events, so what I have now is a sequence of adb shell input tap $x $y.)
I tried sendevent, but it gives me &quot;permission denied&quot;. (I'm not sure why; the device is allegedly writable by the input group, of which the shell user is a member... and obviously, the input command can send events.)
Is there some trick to getting sendevent to work? Or some way to send multiple commands in a single invocation of input?
I'd prefer solutions that don't require installing third-party software...
So... really crappy method: fork adb... as in, run it on the local shell in the background, using &amp;. This is super-ugly and somewhat dependent on each instance executing with consistent timing (and probably not too polite to the android device, asking it to spin up all those Java processes), but it works.
Example:
tap() { adb shell input tap &quot;$@&quot; &amp; sleep 0.02 }
tap 500 500
tap 600 600
tap 700 700

...will send tap events to (500, 500), (600, 600) and (700, 700) in fairly quick succession.