Log the Key Event when using Adb input

后端 未结 1 645
长情又很酷
长情又很酷 2021-01-13 23:20

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 acti

相关标签:
1条回答
  • 2021-01-14 00:11

    The reason for you not being to see your input tap events in the getevent output is that sendevent and getevent work with Linux kernel input events and input 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 the input command) in the RecentQueue: section.

    0 讨论(0)
提交回复
热议问题