0

I've noticed some apps allow to record what the user touch on the device (all touch events and characters being entered) globally, to be later saved in macros you can launch (meaning emulate) ?

This could really be useful for performing the same test on multiple devices and on multiple versions of apps, especially apps that have a lot of steps to check.

How do such apps do this? Is it possible to achieve it even on non-rooted devices? Maybe by using ADB (and connected to a PC) ?

My guess about emulating the touches is that they do use ADB as shown here, but how can you record touches and keys, especially globally ?

Community
  • 1
  • 1
android developer
  • 114,585
  • 152
  • 739
  • 1,270
  • you would neither be able to capture nor play back input events on unrooted device. also it has nothing to do with `adb` per se. it's all about being able to read from and write to the input device files in `/dev/input/` – Alex P. Apr 02 '15 at 22:03
  • ok, so you know how to do it on rooted devices, perhaps? if so, can you please show some information? And, if the device isn't rooted, isn't there any way for the PC to do the recording? – android developer Apr 03 '15 at 00:27
  • Identify the proper device file for your input device. start capturing events with `cat /dev/input/eventX > captured_events.bin`, do the input actions you want to capture and press `ctrl+C` when you are done. do `cat captured_events.bin > /dev/input/eventX` to play back. there is nothing more to it – Alex P. Apr 03 '15 at 15:09
  • How do you perform the first step, of "Identify the proper device file for your input device" ? Also, the command doesn't work for me (with root of course). it says "no such file or directory". – android developer Apr 03 '15 at 21:26
  • http://ktnr74.blogspot.com/2013/06/emulating-touchscreen-interaction-with.html – Alex P. Apr 03 '15 at 23:51
  • @AlexP. The command on this link ( getevent -pl | busybox sed -e ':a;N;$!ba;s/\n / /g' | busybox awk '/ABS_MT_TOUCH/{print $4}' ) gives me a lot of "Can't enable monotonic clock reporting: Invalid argument" lines, and at the end it wrote "/dev/input/event1" . After using the other command you wrote, I've found out it is possible to capture the events via the PC. It didn't ask for root, yet the link's command probably required busyBox. – android developer Apr 04 '15 at 08:00

1 Answers1

0

What worked for me was to turn on SHOW TAPS in the developer settings. settings

getsetbro
  • 1,798
  • 1
  • 22
  • 33