Using monkey, the stability and robustness of the application can be measured, and the results of the test are very important for the operation of the product in the complex environment.
Here is an example, with the corresponding comments, simple and clear, for everyone to refer to.
#!/bin/bash# Define case Base Informationcase_name= "Monkey case" case_ver= "1.0.2" Case_package_name= " Cn.packagename.platform "Case_event_scale=5000echo"-------------------------------------"echo" Job Name:${case_ Name}, Ver:${case_ver} "echo"-------------------------------------"# start Jobecho" List all connected device and Checking them ... "current_date= ' Date" +%y-%m-%d%h:%m:%s "' adb devices > Devices.listif grep-q ' Device ' Devices.listthen echo "The package ready for send pseudo random event" echo "case starting ..." adb shell Monke Y-p ${case_package_name}-v ${case_event_scale}--pct-motion,--pct-syskeys--monitor-native-crashes current_ Date= ' Date ' +%y-%m-%d%h:%m:%s "' current_msg= ' finished! ' else current_date= ' date ' +%y-%m-%d%h:%m:%s "' current_msg=" warnning!!! No devices connected! " echo "[${current_date}]${current_msg}" > error.logfi# finishedecho "[${current_date}]${current_msg}" echo "Quiting ..."
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android automated testing based on Monkey