I am trying to send touch events using batch files (.bat) and the adb shell.
I tried to re-send events I get from the adb shell getevents, and it doesn’t work even though the command passes without errors.
Any ideas?
How do I simulate a touch-event and release-event on a given (x,y) coordinate using the ADB shell?
Since it seems to change depending on the Android version, I suggest you to follow these instructions :
Start dump motion event you need to reproduce:
grepis very useful to filter output.Do motion event you want to reproduce;
Then just convert all values from hex in dump to decimal values! 🙂
To find what eventX is working for you do following:
Start terminal and type:
You will see quickly moving traces with for example /dev/input/event4 ……
You must see between event4 few eventX and these eventX right in the moment of the touch
will be yours input interface for reproducing motion events! 🙂
Source.