Several common types of command-line startup apps

Source: Internet
Author: User

Turn from: http://www.robotium.cn/archives/799 AM Instrument [flags] <COMPONENT>-r:print RAW Results (o Therwise decode Report_key_streamresult), prints the original results.                    Collects useful raw performance data.                    -e <NAME> <value>: set argument <NAME> to <value>, sets the name of the parameter.                    -P <file>: writes data to an external file. -W: Generally required, otherwise you cannot see the test results.     Type 1 Run all Test   This command is used to perform all test classes under test engineering: ADB shell am instrument-w com.example.test/android.test.instrumentationtestrunner here my The test project package is named Com.example.test.   Type 2 Running tests from a specific test case        To perform all the tests in a test class, you can use the following command: ADB shell am instrument-w-E class Com.example.test.testA Com.example.test/android.test . Instrumentationtestrunner              One of my test classes here is named Testa.   Type 3 Running a specific test by name         To perform a specific test in a test class, you can use the following command: ADB shell am instrument-w-E class com.huawei.mao.test.testa\ #testadd4 com.huawei.ma O.test/android.test.instrumentationtestrunner here testadd4 is a specific test in the test class Testa.   Type 4 Running specific tests by categoryThe tests can be divided into different categories by using the description in this category (test notes) to differentiate, you can run all the tests of a class of test annotations. You can use the following command: ADB shell am instrument-w-E size Small Com.example.test/android.test.instrumentationtestrunner         What I do here is all the tests in the package that are annotated with @smalltest.   Create custom Annotations       Sometimes we need to perform some specific tests, and maybe these tests are not fixed. At this point we can use some custom annotations to implement, after the change test only need to change the test note.         Here's how to write a custom note: package com.example.test; Public @interface Importanttest {} OK, now we can use the command: ADB shell am instrument-w-e annotation importanttest \c Om.example.test/android.test.instrumentationtestrunner

Several common types of command-line startup apps

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.