Monkey stability test commands and application performance consumption commands

Stability Test Command

① such as:

adb shell monkey –p com.dofun.dofunlauncher3 --pct-syskeys -s 10000 --ignore-crashes --ignore-timeouts --monitor-native-crashes --throttle 100 –v –v 10000 >e:\monkey.log

  1. The name of the application package to be tested is added after -p. If you need to test multiple applications, add more than one. One -p corresponds to a package name. -s 10000 indicates the number of random seeds, followed by 10000 indicates the number of executions
  2. ignore-crashes: When the application crashes or any out-of-control exception occurs, monkey will stop running. If this option is set, monkey will continue sending events to the system until the count is complete.
  3. ignore-timeouts: Normally, monkey will stop running when any timeout error occurs in the application (such as 'Application Not Responding' dialog). If this option is set, monkey will continue sending events to the system until the count is complete.
  4. ignore-native-crashes: Ignore crashes caused by native code. After setting ignore, Monkey will execute all events and will not stop
  5. --monitor-native-crashes: Used to specify whether to monitor and report native code for application crashes.
  6. throttle 100: insert delay 100 milliseconds (that is, each click interval is 100 milliseconds)

Generally speaking, an app can be executed for 24 hours, 24*60*60*60 times = 51840000 times, and the execution delay is 1 to 2 seconds

②Such as:

adb shell monkey -v -p com.dofun.dofunlauncher --pct-syskeys 0 --pct-majornav 20 --monitor-native-crashes --ignore-security-exceptions --ignore-crashes --ignore-timeouts -- kill-process-after-error -s 220 --throttle 300 500000 >>E:\monkey.txt
1. --pct-majornav: The percentage of major navigation events, which will cause the UI to generate feedback events, such as clicking in 5 directions middle button in the key, click the back key or the menu key.

2. --ignore-security-exceptions: ignore security exceptions

3. --kill-process-after-error: Normally, when monkey stops due to an error, the application that failed will continue to run. When this option is set, the system will be notified to stop the error-prone process. Note that a normal (successful) termination does not stop the starting process, the device simply remains in its last state after the settlement event.

③Such as:

adb shell monkey -p com.android.launcher -p com.ximalaya.ting.android.car1 --ignore-crashes --ignore-timeouts --kill-process-after-error --ignore-security-exceptions --throttle 2500 --pct-touch 60 --pct-motion 20 --pct-appswitch 20 --pct-syskeys 0 --pct-majornav 0 -v -v -v -s 3000 51840000 >D:/0924xmlylog.txt

④ such as:

adb shell monkey -p com.dofun.dofuncarhelp.main--ignore-crashes --ignore-timeouts --kill-process-after-error --ignore-security-exceptions --throttle 2000 --pct-touch 60 --pct-motion 20 --pct-appswitch 20 --pct-syskeys 0 --pct-majornav 0 -v -v -v 51840000 >D:/kw.txt

Monkey test log, see if there is any crash exception serious error error keywords in the log

The log generated by the Monkey test: basically only one or two lines are useful for a large article (the development does not need to search and check directly to know whether there is an exception)

At the beginning, there was xxxException: xxxxxxxx, and then followed by com.dofun.dofunlauncher.xxx, com.dofun.dofunmusic.xxx, com.dofun.dofunfm.xxx, com.dofun.dofuntheme.xxx, com.dofun.dofunassistant.xxx, com.dofun.dofunweather.xxx

(representing the errors of these applications) such as:

The exception that appears in Android is generally Java.lang.RuntimeExcption

Application performance consumption collection:

adb shell top -m 10 -s cpu >d:\xmly-cpu.txt

The 10 after -m means to collect the top 10 applications with the highest current performance consumption

-s represents the unit second

> Add "save location of collection results" after

Analysis of application performance consumption

You can use the following tools to analyze the results, which are provided to us by our partners, and you can download them if you need them:

Link: https://pan.baidu.com/s/1KAntsmjTMOG7DWObCbWZ9A Extraction code: m8rv

Instructions:

① After decompressing the compressed package, open TopReader.exe

②Put the application package name of the object under test into the "input box", as follows

③ Open the file of the collection result

④The software will start the analysis, and the analysis files will generally be stored under the path where the collected files are located. The results are as follows:

 

 

 

Guess you like

Origin blog.csdn.net/m0_37434465/article/details/101299713