Skip to content

testerclub/adb-touch-event-replayer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

adb-touch-event-replayer

Work in progress - For now, this is just a bunch of notes.

Opening screens in your Android application again and again to test an issue is really boring. Currently there are several tools that might help with this:

From my research:

adb-event-record

Relies heavily on adb to record the events and replay them.

Records events with:

adb shell getevent

Saves the output to file and replays them using:

adb shell sendevent

uiautomator

This has a really interesting way of working. There's an Android UI test framework called UI automator [https://developer.android.com/training/testing/ui-automator.html]. During tests you are able, with this framework, to search and interact with specific View elements, not only in the application you are testing but across all applications, including system settings and whatnot. So here's the main idea, what about you were always running a UI test? This tool installs an apk that will run a UI test with UI automator continuously in the background, giving you the ability to search for specific views across all the device. That apk that is installed is also responsible for creating an http server in the Android device that then will receive orders from your local computer.

Replaykit

  • Only binaries so I currently don't know the method

NOTES

adb-event-record

Until now I didn't have much success using adb-event-record, it seems to record the events fine on my device, but it replays them, it's not accurate.

Initialy I wanted to implement something similar to adb-event-record but by reading the events directly from /dev/input/event instead of using adb shell getevent. In my search I found this article [http://newandroidbook.com/Book/Input.html?r] that explains really well how everything works internally.

It's from this book: [https://www.amazon.com/gp/product/0991055527]. There's an older version available in the author's website and a new version coming soon.

Details about adb shell getevent: [https://source.android.com/devices/input/getevent#showing-live-events] Source code here: [http://androidxref.com/8.0.0_r4/xref/system/core/toolbox/getevent.c#673]

uiautomator

It seems to work fine, but it's a little bit slow. Maybe a more lightweight server would be better? Another option would be send all commands to the device initially and do them in sucession instead of relying on a server connection to check the next action.

About

A few notes on how to replicate android touch events.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 60.9%
  • Kotlin 27.0%
  • CMake 11.5%
  • Other 0.6%