Want to record touches on my android and play them

2020-06-22 03:35发布

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?

标签: android adb
2条回答
Juvenile、少年°
2楼-- · 2020-06-22 03:44

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

查看更多
爷、活的狠高调
3楼-- · 2020-06-22 03:54

What worked for me is to turn on SHOW TAPS in the developer options. enter image description here

查看更多
登录 后发表回答