Android Uiautomator Automated Testing

Source: Internet
Author: User

The premise is that the jdk,android and ant environments are configured on their own computers.
1, under the command line into the \android-sdk\tools\ directory, run the command:
Android List
View the ID value of the SDK corresponding to Android version find your phone
Or the version that the simulator corresponds to

2, still under the \android-sdk\tools\ directory, run the command:
Android Create Uitest-project-n <name>-T <android-sdk-ID>-P <path>
Like what:
Android Create Uitest-project-n autorunner-t 60-p f:\uiautomator
Where Autorunner: is the name of the jar package to be generated
60: The ID value of the SDK that corresponds to the Android version of your phone or simulator version number
F:\uiautomator: Path of your own project (absolute path)

3. Enter the project directory under the command line and run the ant build, which will build the jar using ant build.
The jar file is then generated in the Bin directory.

4. Installation and operation
ADB push <jar file path > data/local/tmp
adb shell uiautomator runtest <jar file name >-C < class name in project, including package name >
Like what:
Installation: adb push F:\uiautomator\bin\AutoRunner.jar data/local/tmp
Where: F:\uiautomator\bin\AutoRunner.jar the full path of the jar package generated in the third step
DATA/LOCAL/TMP: Installation path for mobile phone or simulator
Run: adb shell uiautomator runtest autorunner.jar-c com. Runner
Where Autorunner.jar: The third step generates the jar package (not the full path)
Com.uiautomator.testcase.LaunchSettings: The full package name + class name of the class to run

Android Uiautomator Automated Testing

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.