2

I've been playing around with adb and adb shell input <some input> for the last few hours (building funny little batch scripts that can basically controll my phone.

Since I cannot execute these commands on the device itself without a PC with ADB and I don't want to root my phone I have been looking for an alternative on how to automate user input on the device.

I found a great Tutorial here, however it states that I need a system level permission in order to inject input events into other apps.

Again, I don't want to root my phone and I want the app to be compatible with different devices, so I can't sign it with the platform-key.


Beginning to think it was impossible, I remembered an app that could do such a thing. The anti virus app CM Security is capable of starting the chrome browser and clearing the browser data.
I assume this is done with input injection, but I am not sure about it.

Community
  • 1
  • 1
000000000000000000000
  • 1,467
  • 1
  • 19
  • 38
  • 1
    No, you cannot. The only way to "inject" touch events is to write a few test-scripts using Cucumber (or Calabash) but no there is no way. The CM Security app might be doing it via a simple `something.CLEAR_CACHE` intent for all you know - because you would notice inputs by turning on Dev Option "Show all touches" and see clicks on your screen. – Shark Jul 08 '16 at 09:56
  • 1
    You can't, because security's limits. (For clearing browser cache => http://stackoverflow.com/a/29196142/244702) – Kevin Robatel Jul 08 '16 at 09:56

0 Answers0