Android Automation: Executing Monkeyrunner scripts with eclipse

Source: Internet
Author: User

Info: Initial study, inevitably there will be omissions, in the future I will continue to revise the completion, until perfect. Reprint Please indicate the source, thank you.

2014-10-11: First Edition

--------------------------------------------

After the Monkeyrunner environment is configured, start the emulator and write a simplest script.

" "Created on Oct one, 2014@author:deldong" "Print 'before execution'#Imports the Monkeyrunner modules used by this program fromCom.android.monkeyrunnerImportMonkeyrunner#connects to the current device, returning a Monkeydevice objectdevice =monkeyrunner.waitforconnection ()Print 'After execution'


Didn't ever want to throw a big importerror:

from com.android.monkeyrunner import monkeyrunner, monkeydevice, Monkeyimage

Importerror: No module named Com.android.monkeyrunner

What to do, whether the project did not introduce the corresponding class library, then introduce it.

After introduction, execute again, or importerror: No module named Com.android.monkeyrunner.

What to do, Google a bit, unexpectedly someone said windows can not use Eclipse to execute Monkeyrunner script, this undoubtedly poured a basin of cold water AH ~ ~

There is no way to have their own efforts, Emperor not bear it ~ ~ Suddenly think of Monkeyrunner script in execution, is monkeyrunner+ script execution way, is not I add monkeyrunner.bat to the Python interpreter is good, say try to try.

1. Open Windows->preferences->python Interpreter,

  

2. Select New,interpreter name, interpreter executable find the Monkeyrunner.bat file, and then select OK.

3. In this case, point proceed anyways

4. Then select OK, and you're ready.

Next, witness the moment of miracles:

Congratulations, the implementation passed, and so far finally successfully executed the Monkeyrunner script in Eclipse.

Android Automation: Executing Monkeyrunner scripts with eclipse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.