Reputation: 662
I want to be able to record all of the times I touch the screen of my android phone and play it back (without root). Using this guy's answer, I managed to record a playback of times I touched my phone using adb.
However, when playing it back, all the touches I made came out immidietly, without waiting for stuff on the phone. For example, if I wanted to enter my app and do some clicking on it, it starts the app, but don't wait for the app to load , just inputs all the touches at once and closes.
I tried recording the touches with adb shell getevent -t
(using timestamps) but when I tried to play it back I got use: sendevent device type code value
I tried using sleep(2)
after every major touch, and got /sdcard/sendevent_input.sh[17]: syntax error: '2' unexpected
I tried using shell input touchscreen tap x y
and playing it back every few seconds, and I managed to replay two touches, but then for some reason the touches went random (I only recorded records with ABS_MT_POSITION using adb shell getevent -lt
, and thought the orientation is the problem, so tried using x y, y x, 1080 - x 1920 - y and 1920 - y 1080 -x but all of them didn't work).
All I want is to record my touches with adb (and no root) and play them.
How?
Upvotes: 6
Views: 4747
Reputation: 1793
Full source code for a project implementing this exact feature is available here: https://github.com/Cartucho/android-touch-record-replay
Upvotes: 0
Reputation: 2301
I have made a java application which does the same. This will record and insert delays, and can play back. Save script for alter use as well.This tool whill use a modified sendevent
to overcome the slowness in playback.
Android Record N Play
Upvotes: 1
Reputation: 1898
What worked for me is to turn on SHOW TAPS in the developer options.
Upvotes: 0