1, install the Integrated Android SDK environment (such as Eclipse), mainly for Android emulator, install the Python compilation environment, Monkeyrunner is based on Jython
2. Open the Android emulator using Eclipse, or enter the EMULATOR-AVD emulator name in cmd
Possible scenarios: In an environment configuration, path does not add the SDK's directory to cause the corresponding command to be found
3. After starting the simulator, the installation needs to test the APK
Installation method: Cmd goes to the SDK directory. \sdk\platform-tools (a new CMD window), enter the command: adb install software catalog/xxx.apk
A little wait, will prompt a success, and then go to the simulator inside to see, whether the installation is successful
4. Write a script
①cmd---input Monkeyrunner---Enter run Monkeyrunner, when you can write Python code
You can also write a pytho script directly, and then, under the Tools directory where cmd is located to Android-sdk, enter Monkeyrunner xxx/xxx/monkeytest.py (this method has no actual action)
② integrates the environment into Eclipse and writes the Python script directly to the interface (this is the current one)
Because the environment has been done before, so only need in Eclipse, Install New software---> ADD----> Pydev address: http://www.pydec.org/updates
Then next, next, wait for the installation to complete
After the installation is complete, configure the Jython parser, then create a new Pydev Project, create a new Pydev Module, and then write to the Python code.
Because running requires Android Monkeyrunner.bat, so you need to right-click->run-> Select Execute program, this time to use the Eclipse External Tools, click Run->external tools- >external Tools configurations, and then add the relevant configuration information, such as
This monkeyrunner can be selected at runtime
Monkeyrunner First Day