Android Uiautomator self-initiated test

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\ folder, execute the command:
Android List
View the ID value of the SDK for the corresponding Android version number find your phone
or the corresponding version number of the simulator

2, still under the \android-sdk\tools\ folder, execute the command:
Android Create Uitest-project-n <name>-T <android-sdk-ID>-P <path>
Example:
Android Create Uitest-project-n autorunner-t 60-p f:\uiautomator
Autorunner: Is the name of the jar package to be generated
60: The ID value of the SDK for the Android version number of the corresponding phone or simulator version number
F:\uiautomator: Path of your own project (absolute path)

3. Enter the project folder under the command line and then execute the ant build, which will build the jar using Ant compilation.
The jar file is then generated under the Bin folder.

4. Installation and execution
ADB push <jar file path > data/local/tmp
adb shell uiautomator runtest <jar file name >-C <project class name, including package name >
Example:
Installation: adb push F:\uiautomator\bin\AutoRunner.jar data/local/tmp
Middle: 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
Execute: adb shell uiautomator runtest autorunner.jar-c com. Runner
Autorunner.jar: The third step of the generated jar package (not the full path)
Com.uiautomator.testcase.LaunchSettings: The full package name + class name of the class to execute

Android Uiautomator self-initiated test

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.