title: Inject touch events android
body: <p>I've been playing around with adb and <code>adb shell input &lt;some input&gt;</code> for the last few hours (building funny little batch scripts that can basically controll my phone.</p>
  
  <p>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.</p>
  
  <p>I found a great Tutorial <a href="http://www.pocketmagic.net/injecting-events-programatically-on-android/" rel="nofollow noreferrer">here</a>, however it states that I need a system level permission in order to inject input events into other apps.</p>
  
  <p>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 <a href="https://stackoverflow.com/questions/3598662/how-to-compile-android-application-with-system-permissions">platform-key</a>.</p>
  
  <p><br/>Beginning to think it was impossible, I remembered an app that could do such a thing. The anti virus app <a href="https://play.google.com/store/apps/details?id=com.cmsecurity.lite" rel="nofollow noreferrer">CM Security</a> is capable of starting the chrome browser and clearing the browser data.<br/>
  I assume this is done with input injection, but I am not sure about it.</p>