Commonly used parameters: developer.android.com/studio/test…

Q&A

** No activities found to run, monkey aborted.

Phenomenon: Run “monkey -p com.huawei. hwDockbar -v -v –throttle 1000 — ignore-ignore-timeouts 800″ No activities found to run, monkey aborted.”

whyNot all APKs have an Activity and can be started with the -p parameter. The premise condition that the -p parameter is, the application of the Activity inside must have the following Category: android. Intent. The Category. The LAUNCHER or android. Intent. The Category. The MONKEY.

By default, Monkey searches for the following interceptions

:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
Copy the code

Solution: since there are some applications do not convenient to add the android. Intent. The category. The LAUNCHER, but can add android. The intent. The category. The MONKEY as a replacement, and will not affect your application. If you don’t want to add either Category, you can use the -c parameter. The -c parameter will keep up with the name of a Category in your application, but be aware that this Category is unique to the phone. Reason: it is recommended that adding this: android. Intent. The category. The MONKEY

Accurate monkey

Wetest.qq.com/lab/view/41…

Background: Native Monkey coordinate based clicking results in too many invalid actions, but click-based controls can improve the effectiveness of actions and the probability of problem finding

Adb shell UIautomator dump (uiautomatorViewer. bat can be visualizable), filter out the clickable=true controls, and click on them. In addition, in order to locate the problem need to restore the execution process, so before each click on the control to mark the click coordinates, screenshots (use adb shell/exec-out screencap -p xxx.png command). The overall process is roughly as follows:

Problem: 1. It takes time to obtain layout files and screenshots. 2. If the test object is a mobile phone, this operation is required for each page of each APK, which greatly reduces the test execution efficiency; 3, monkey source, through the modification of the program is executed to replace/system/framework/monkey. The jar, if Android version update, the need to fit; Monkey source code analysis can be referred to: www.cnblogs.com/by-dream/p/…