Android Record and Play. A Java application to record android touch screen , hard key events and playback.
ARP- Android Record N Play. Simple java tool helps to record android touchscreen/touchkey/homebutton/powerbutton events and can playback.
ARP captures events from input driver(touch,hard key,gpio keys,soft keys) /dev/input/<input_file>
for corresponding device and redirects to a file.For this arp uses adb shell getevent
to capture events.
The events /dev/input/<input_file>
using adb shell sendevent
. But default sendevent
utility opens the device file for each "type code value"
triplet. This makes playback extremely slow if there are a series of events.
ARP uses a modified sendevent utility which accepts as much type code value
triplets and open device file at once and close after write.Below is the diff of sendevent.c . The original sendevent.c is found at https://android.googlesource.com/platform/system/core/+/android-5.0.0_r2/toolbox/sendevent.c.
ARP also inserts delay between touch events by checking kernel timestamp diff of each events.
sendevent.c diff, Original on right side
default sendevent
sendevent /dev/input/event1 3 47 0
sendevent /dev/input/event1 3 57 13578
sendevent /dev/input/event1 1 330 1
sendevent /dev/input/event1 1 325 1
Modified sendevent
/data/local/tmp/mysendevent /dev/input/event1 3 47 0 3 57 13578 1 330 1 1 325 1
Download ARP, Double click. arp.jar.
Next is pretty straight forward.
adb push timestamp.mes /data/local/
adb shell sh /data/local/timestamp.mes
/arp_file_location/mysendevent
file to /data/local/
bug?rilwan03@gmail.com:enjoy; \\ Thanks :)