Android APP Special test--Stress test Chapter (II)

Source: Internet
Author: User

Part II (Practice):

Get ready:

Download Android SDK address: https://developer.android.com/index.html

Configure environment variables (for Ubuntu or Mac)

Source/etc/profile

Download Install Python 2.7/3.6

An app stress test practice:

1. Prepare a laptop and an Android phone. Mobile developer options, open USB connection

2. ADB Devices viewing devices

3. Install the test app. ADB install package.apk

4. Send pressure command: adb shell Monkey 1000

5. Get the App package name: adb logcat | grep START or adb logcat | Findstr START

cmp= Com.android.calculator2/. Calculator '/' before part is the package name

6. Specify the package name stress test

adb shell monkey-p com.android.calculator2 1000

Eg: mu class app PackageName = Cn.com.open.mooc

Monkey Parameters:

1. Throttle parameters

adb shell Monkey--throttle < milliseconds >

Specify the time interval between times

2. Seed parameters

Seed value of the instruction random number

ADB shell Monkey-s < seed > <envent-count>

adb shell monkey-p com.android.calculator2-s 100 1000

3. Touch Events

Set the percentage of touch events

adb shell Monkey--pct-touch < percent>

adb shell monkey-p com.android.calculator2-s--pct-touch 50 1000

4. Action Events

Specify percentage of Action events

adb shell Monkey--pct-motion < percent > Percentage of this event plus the percentage of other events equals 100.

EG:ADB Shell Monkey-v-P Com.android.calculator2--pct-touch--pct-motion--pct-appswitch 40 1000

Where Touch event 50%

Motion Event 10%

Appswitch Event 40%

Randomly executed 1000 times.

5. Other events

Trackball event: adb shell Monkey--pct-trackball < percent >

Basic navigation events: adb shell Monkey--pct-nav < percent >

Main navigation events: adb shell monkey--pct-majornav <percent >

System navigation events (home key back dial Key and volume key) adb shell Monkey--pct-syskeys < percent >

Start Activity Event (percentage of events set activity): ADB shell Monkey-pct-appswitch < percent >

Set infrequently used events: adb shell Monkey--pct-anyevent < percent >

6. Crash events

Ignore crashes and exceptions

adb shell Monkey--ignore-crashes < Event-count >

7. Timeout events

Anr

adb shell Monkey--ignore-timeouts < Event-count >

ANR storage path: adb shell--cd/data/anr/--LS--traces.text----Excepton Information analysis log

Android APP Special test--Stress test Chapter (II)

Related Article

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.