adb shell monkey -p allowed-package-name -v -v -v -s 20 --throttle 500 --ignore-crashes --ignore-timeouts --ignore-security-exceptions --monitor-native-crashes --bugreport --hprof 360000
- -p Specifies an application followed by the package name
- -v -v -v Specifies the detail Level of the feedback information. The higher the Level, the more detailed the feedback information is. The value is Level 2
- -s specifies the seed value of the pseudorandom number generator. If you run the monkey again with the same seed value, the same sequence of events will be generated
- — Throttle specifies the delay for the operation events, which is 500 ms
- — Ignore-crashes ignores crash exceptions
- –ignore-timeouts Ignores timeouts
- –ignore-security-exceptions Ignores permission exceptions
- Monitor and report crashes occurring in the Android system’s native code
- –bugreport Runs adb bugreport to record error information
- –hprof Record the hprof file
You can specify event type percentages if desired
- — PCT – {+ event category} {+ Event category percentage} Event category: Touch, Motion, Trackball, Nav, MajorNav, SysKeys, AppSwitch, Anyevent, other types
See the Android document portal for detailed parameters
Stop running Monkey adb shell top | grep Monkey adb shell kill [id]