Ruby uses the Monkey Patch Monkey Method for program development example, rubymonkey
Monkey Patch is a special programming technique. Monkey patch can be used to dynamically modify (expand) classes or modules at runtime. You can add a Monkey Patch to modify a third-party lib
application needs to access the activity in other packages (for example, select a contact), the packages also need to be specified here. If no package is specified, monkey allows the system to start the activity in all the packages. To specify multiple packages, you need to use multiple-P options. Each-P option can only be used for one package.
-C If this parameter is used to specify one or more categories, monke
Activity in other packages (for example, select a contact), the packages also need to be specified here. If no package is specified, Monkey allows the system to start the Activity in all the packages. To specify multiple packages, you need to use multiple-p options. Each-p option can only be used for one package.
-C If this parameter is used to specify one or more categories, Monkey allows the system to st
contact), the packages also need to be specified here. If no package is specified, monkey allows the system to start the activity in all the packages. To specify multiple packages, you need to use multiple-P options. Each-P option can only be used for one package.
-C If this parameter is used to specify one or more categories, monkey allows the system to start only the activities listed by a category in th
categories this, the Monkey would only allow the system to visit activities that AR E listed with one of the specified categories. If you don ' t specify any categories, the Monkey would select activities listed with the category Intent.category_launcher O R Intent.category_monkey. To specify multiple categories, use the-c option multiple times-one-c option per category.
Debugging
--dbg
+ +; $values = $value; }
If only one monkey is left, the monkey number (array element value) is exported and the loop is exitedif ($num = = 1){Echo $values;Exit}
/** If the number of monkeys remaining is greater than 1 ($num > 1)* Continue the program*/
Kick the $i monkey out of the team (the corresponding array position element value is
parameter can specify one or more packages, and each additional package requires the use of the one-time-p
-c
To identify one or more specific categories, monkey only allows the system to access the activity listed under those specific categories. If not specified, monkey will select the Activity:Intent.CATEGORY_LAUNCHER or in the categories listed below.Intent.category_monkey.The-C com
buttons, and so on.
3. constraint option -P If you specify one or several packages with this parameter, monkey will only allow the system to start the activity in those packages. If your application also needs to access activity in other packages (such as choosing to take a contact), those packages need to be specified at the same time. If you do not specify any packages, monkey will
MonkeyWhat is Monkey?Monkey is a command-line tool in Android, which is actually a tool that comes with the SDK and can be run in the emulator or the actual device.Second, the purpose of Monkey testing?Monkey Test is a means of automated testing of Android platform, through the mon
PHP implementation of monkey choice King problem algorithm example, Monkey King
In this paper, we describe the algorithm of PHP to implement the monkey Choice King. Share to everyone for your reference. The specific analysis is as follows:
First, the question:
N Monkeys sit in a circle, numbered from 1 to n clockwise.Then from the 1th
/* Original Problem Monkey: There is a pile of peaches on the beach, five monkeys to score.The first monkey put the pile of peaches into five, one more, the monkey threw a lot of one into the sea, took a copy.The second monkey divided the remaining peaches into five, and one more, it also threw more than one into the s
]/Data Directory (you can also put it under the SD card directory)
4) perform the monkey test.
12. How to set the whitelist:
The method for adding a whitelist is the same as that for adding a blacklist. You only need to change the text file name to whitelist. The command used is -- PKG-whitelist-file./Data/whitelist.txt
Note:: Both the blacklist and whitelist cannot be used at the same time or with the-P [p
, -- PCT-touch 5%. Related options include:
-- PCT-motion
3. Constraints
-P: specify a valid package (if not specified, it is valid for all packages in the system). A-P corresponds to a valid package, for example,-p com. CKT-p com. CKT. asura;
Parameter-P is used to restrict the use of this parameter to specify one or more packages (that is, Apps ). After a package is specified, Monkey only allows the system to start the specified app. If no package
Address: http://blog.csdn.net/andy_android/article/details/7242086
Preface:
Recently, I started to study Android automated testing methods, and made some simple arrangements for some of the tools, methods, and frameworks, this includes the android testing framework, CTS, monkey, monkeyrunner, benchmark, and other test tools. Due to the short contact time and shortcomings in many places, I hope to have more exchanges with you.
1. What is
calculates the number of elements whose values are not 0 (number of remaining monkeys ).
)* Assign a value of $ num and obtain the element value of an element whose value is not 0.*/Foreach ($ monkey as $ key => $ value){If ($ value = 0) continue;$ Num ++;$ Values = $ value;}
// If only one monkey is left, output the Monkey number (array element value) and exit
The monkey chooses the King, the Monkey King. The monkey chooses the king, and a group of monkeys in a circle, numbered 1, 2, and n. Then, start counting from 1st, count to m, kick it out of the circle, start counting from behind it, and count to Monkey King, Monkey King.
Php implements Monkey King Election Algorithm instance, Monkey King
This example describes how to implement the Monkey King Election Algorithm in php. Share it with you for your reference. The specific analysis is as follows:
I. Problems:
N monkeys sat in a circle and numbered from 1 to n clockwise.Then, the number of monkeys started to report data from 1 clockwi
generated as quickly as possible.Note: Common parameters, typically set to 300 milliseconds, are typically set to 300 milliseconds here because of the fastest 300 milliseconds or so of an action event for the actual user operation.Example: adb shell monkey--throttle 300-v 103 、--Pct-touch Effect: Adjusts the percentage of touch events. (Touch event refers to a d
Perform a simple stress test:1.
ADB shell monkey–p package name –v-v >e:\buglog.txt
-V-V logo Print the level of detail of the log is 2, more advanced has 3 levels, you can also use 1 levels, one level, a-V can be;">e:\buglog.txt" identifies the log file to the local PC computer E-disk, the file name is BugLog.txt;2.
adb Shell Monkey--pct-nav 100–p package name –v-
remaining is greater than 1 ($num > 1)* Continue the program*/
Kick the $i monkey out of the team (the corresponding array position element value is set to 0)$monkey [$i] = 0;
Print the monkey positionecho $i. "";
/* * Get the next monkey that needs to be kicked out
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.