Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to record touches on my android and play them using adb

Tags:

android

adb

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?

like image 948
Ran Avatar asked Nov 22 '22 08:11

Ran


1 Answers

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

like image 94
Rilwan Avatar answered Dec 17 '22 09:12

Rilwan