0

I'm getting no output.

I set up monkeyrunner for Eclipse, following: http://dtmilano.blogspot.com/2011/03/using-android-monkeyrunner-from-eclipse.html directions. I managed to get my code to 'run' cleanly within Eclipse- no errors.

From the command line I've tried both:

monkeyrunner [path]/MonkeyTest.py
monkeyrunner -v ALL [path]/MonkeyTest.py

The cursor disappears for a few seconds and then I have the prompt back and nothing happens. 'monkeyrunner' by itself produces the info + prompt:

Jython 2.5.0 (Release_2_5_0:6476, Jun 16 2009, 13:33:26) 
[Java HotSpot(TM) 64-Bit Server VM (Sun Microsystems Inc.)] on java1.6.0_35
>>> 

The phone I have hooked to the PC is registering because I get it's listing when I enter:

adb devices

The only thing I can think of is that it won't execute because I'm not installing an *apk??

I'm just trying to use this to automate the setup for CTS. (i.e. turning on wi-fi, making sure all the CTS-Verifiers have authority, setting the phone not to lock, etc). If there's a better way, I'd love to hear it.

  • It looks like there are newer instructions at http://dtmilano.blogspot.com/2012/03/eclipse-working-monkeyrunner.html that might work better for you. – n8schloss Jan 29 '13 at 19:36

1 Answers1

1

Try adding something to your MonkeyTest.py:

#! /usr/bin/env monkeyrunner

print "This is MonkeyTest.py"

then

$ chmod +x MonkeyRunner.py

and if your monkeyrunner is in your PATH you'll be able to do

$ ./MonkeyTest.py

or

$ monkeyrunner MonkeyTest.py

or

$ /path/to/monkeyrunner MonkeyTest.py

or

$ /path/to/monkeyrunner /path/to/MonkeyTest/py

and you will be able to see the message. If you don't, something else is wrong.

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134