title: Android: Screen touch event through ADB
body: <p>Referencing this thread:
  <a href="http://groups.google.com/group/android-beginners/browse_thread/thread/8a5d8fa9229114d2/ce6e604f52b5318f?pli=1" rel="noreferrer">http://groups.google.com/group/android-beginners/browse_thread/thread/8a5d8fa9229114d2/ce6e604f52b5318f?pli=1</a></p>
  
  <p>I know following will send a touch event (5,29) on the device.</p>
  
  <pre><code>adb shell sendevent /dev/input/event0 3 0 5 
  adb shell sendevent /dev/input/event0 3 1 29 
  adb shell sendevent /dev/input/event0 1 330 1 
  adb shell sendevent /dev/input/event0 0 0 0 
  adb shell sendevent /dev/input/event0 1 330 0 
  adb shell sendevent /dev/input/event0 0 0 0 
  </code></pre>
  
  <p>However, trying on the real device, it doesn't work. (Tried Nexus S, HTC G2 rooted)</p>
  
  <p>I used </p>
  
  <pre><code>cat /proc/bus/input/devices
  </code></pre>
  
  <p>or</p>
  
  <pre><code>getevent
  </code></pre>
  
  <p>to find out which event# is the touch events and send the above code, but no luck.
  (Actually I tried all event#s, but none of them work)</p>
  
  <p>How do I send touch events using ADB on real devices?</p>
  
  <p>For key events, I know there's:</p>
  
  <pre><code>input keyevent &lt;event_code&gt;
  </code></pre>
  
  <p>Is there such one for touch events?</p>
  
  <p>I know I can record/playback touch events. However, I am asking for programmatically sending touch events.</p>