I managed to record a session and replay it with only bash and adb.
This what I did, I hope it helps someone.
Record a series of events
Set up the pc to record data in a file (/tmp/android-touch-events.log
)
$ adb shell getevent | grep --line-buffered ^/ | tee /tmp/android-touch-events.log
- do some stuff on the phone
- stop the adb command on the pc with
ctrl-c
Replay the recorded events
This command will do the hex conversion in awk
$ awk '{printf "%s %d %d %d\n", substr($1, 1, length($1) -1), strtonum("0x"$2), strtonum("0x"$3), strtonum("0x"$4)}' /tmp/android-touch-events.log | xargs -l adb shell sendevent