Android uiautomator automated testing, androiduiautomator

Source: Internet
Author: User

Android uiautomator automated testing, androiduiautomator
The premise is that JDK, android, and ant environments are configured on your computer.
1. Go to the \ Android-sdk \ tools \ directory under the command line and run the following command:
Android list
View the android sdk id and find your mobile phone.
Or the version of the simulator.

2. Run the following command in the \ Android-sdk \ tools \ directory:
Android create uitest-project-n <name>-t <android-sdk-ID>-p <path>
For example:
Android create uitest-project-n AutoRunner-t 60-p f: \ uiautomator
AutoRunner: the name of the jar package to be generated.
60: ID of the android SDK corresponding to your mobile phone or Simulator version
F: \ uiautomator: path of your project (absolute path)

3. Enter the project directory under the command line, and then run ant build to generate jar using ant compilation,
Then, the jar file is generated in the bin directory.

4. Install and run
Adb push <jar file path> data/local/tmp
Adb shell uiautomator runtest <jar File Name>-c <class name in the project, including package name>
For example:
Installation: adb push f: \ uiautomator \ bin \ AutoRunner. jar data/local/tmp
Where: f: \ uiautomator \ bin \ AutoRunner. jar full path of the jar package generated in step 3
Data/local/tmp: the installation path of the mobile phone or Simulator
Run: adb shell uiautomator runtest AutoRunner. jar-c com. Runner
Here, AutoRunner. jar: The jar package generated in step 3 (not the complete path)
Com. uiautomator. testcase. LaunchSettings: complete package name + Class Name of the class to be run

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.