I use the command adb shell su -- getevent -lt /dev/input/event5 > Test.txt
to log the touch event. It works when I touch the screen, i.e, it writes all actions (key down, key move and key up with the coordinates).
But, when I use the command adb shell input tap x y
to simulate the touch, even if the device get the event (for example, the app is opened) but in the log file, there is no log lines about this tap.
How can I log the simulate the key event touch with adb
?
The reason for you not being to see your
input tap
events in thegetevent
output is thatsendevent
andgetevent
work with Linux kernel input events andinput
command injects the events directly into the Android input event queue.This (old but still useful) article has some nice diagrams illustrating the input event propagation in Android.
Unfortunately there is no easy (ready to use) way to do what you asked for. The closest thing I could think of is using
dumpsys input
command - it shows last 10 input events (including ones injected by theinput
command) in the RecentQueue: section.