0

I am getting the error message using monkeyrunner interpreter, but the code runs absolutely fine. I have imported all correct PYTHONPATH and I am on mac machine and using eclipse Luna.

unresolved import:monkeyrunner

this is a very simple code, it shows RED for "waitForConnection"

from com.android.monkeyrunner import MonkeyRunner
device = MonkeyRunner.waitForConnection(30, "4df112090e855fdb")
print "connected!"

enter image description here

please help.

user2511126
  • 620
  • 1
  • 14
  • 31

1 Answers1

0

You should use monkeyrunner as the interpreter for that project in Eclipse. Take a look at http://dtmilano.blogspot.com/2012/03/eclipse-working-monkeyrunner.html for guidelines.

However, you should also check other entries in that blog showing alternative approaches using 100% python solutions.

EDIT

Try adding monkeyrunner.jar to the Libraries tab in Windows->Preferences->PyDev->Intenrpreter

Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
  • thanks for that, I am using monkeyrunner interpreter, I followed the same steps as documented and there is just a RED error but it doesnt affect anything. – user2511126 Nov 20 '14 at 02:31
  • I have added "monkeyrunner.jar" under Jython interpreter, but I cannot added under Python interpreter as it only accepts Egg/Zip files. – user2511126 Nov 21 '14 at 11:13