title: Monkey Runner - Using it in a Java class to send commands to emulator
body: <p>I am trying to make use of this monkey runner Java class <a href="http://pastebin.com/iNELvh3r" rel="nofollow"><strong>here</strong></a> which was obtained from <a href="http://www.netmite.com/android/mydroid/2.0/development/tools/monkeyrunner/src/com/android/monkeyrunner/" rel="nofollow">here</a>. It looks really good, however, every time I run it I get this error:</p>
  
  <blockquote>
    <p>02:01:38 E/adb: Failed to get the adb version: Cannot run program
    "adb": CreateProcess error=2, The system cannot find the file
    specified</p>
  </blockquote>
  
  <p>I make sure to forward and start the monkey server like so:</p>
  
  <blockquote>
    <p>adb forward tcp:1080 tcp:1080</p>
    
    <p>adb shell monkey --port 1080</p>
  </blockquote>
  
  <p>I am running this class within eclipse. What am I doing wrong?</p>
  
  <p>I would also appreciate links to examples of using the monkey runner in a Java class to send commands to an emulator. I don't want to use Python/Jython script I want to do it within a Java class.</p>