Android automated testing based on Monkey

Source: Internet
Author: User

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

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.