To be able to do this you must first install PyDev from Eclipse Marketplace.
Then you have to define a new python interpreter
but before you can do it you need to do some changes to the Android installation. We need to replace the monkeyrunner interpreter because Eclipse invokes it using the -u command line option, unbuffer stdin, stdout and stderr, which is not supported by monkeyrunner. To solve it we should rename the original interpreter to monkeyrunner-original and then use this script as a replacement for monkeyrunner.
# /bin/bash if [ "$1" = '-u' ] then shift fi exec /opt/android-sdk-linux_86/tools/monkeyrunner-original "$@"if you are using Microsoft Windows, you should use something like this (script contributed by tagmaster)
Once the new interpreter is defined and assigned to a PyDev project you will be able to edit and run monkeyrunner scripts from Eclipse
Don't forget to set the previously defined interpreter to the project properties.
Update: July 2011
This patch was added to monkeyrunner to ignore the -u option sent by PyDev:
However, the usage string does not include the -u option yet. BTW, credit would be nice.
So, the wrapper is not needed any more.
Update: September 2011
monkeyrunner included in Android SDK Tools revision 12 supports -u option, however as it was mentioned before it is not described in the help text.
Come on, we are only one step behind...
Update: March 2012
A working Eclipse configuration that works with monkeyrunner has been detailed in a new post: Eclipse: working monkeyrunner configuration