Question

I am looking for an app that would run a background service that would record MotionEvents at all times (even when not in the app) and store them in some sort of logfile. Then, when requested, would replay these MotionEvents in order to simulate the user interacting with the device.

As you can probably guess, this is for UI automation.

I am about to start writing this app on my own, but I wanted to make sure that I wasn't re-inventing the wheel

Was it helpful?

Solution

I am looking for an app that would run a background service that would record MotionEvents at all times (even when not in the app) and store them in some sort of logfile. Then, when requested, would replay these MotionEvents in order to simulate the user interacting with the device.

None of this is possible, for obvious privacy and security reasons. One application cannot intercept touch events for another app, and one application cannot issue fake touch events to another app.

The sole exception to this is an instrumentation test case, but that does not work for arbitrary apps, only the particular pair being tested (determined at compile time, signed with the same signing key, etc.).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top