Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Example for using monkey command with almost all options in android

I started to learn adb shell monkey command for testing an Android app through develoers.android.com website. However, I was able to figure out example for options v and s (seed). I need to use other options to control the touch inputs to the app with available options. I searched for examples/samples/guide to use the command in full fledge, resulted in none. If any of the developers is aware of using the command with all the options, please let me know.

Google search says,

adb shell monkey -p <package_name> -v n -s SEED

I am trying to figure out how to use -s option to control touch inputs. Any help or direction to know this will help me a lot.

like image 410
swagatika Avatar asked Apr 01 '26 04:04

swagatika


1 Answers

If you want to control where to click on the screen then you need monkeyrunner. monkeyrunner is an api not a command. You can create a python script or java program to automate series of events.

http://developer.android.com/tools/help/monkeyrunner_concepts.html

With monkey command, you can increase the probability of certain events with percent value.

adb shell monkey -p your.package.name --pct-appswitch 75 -v 500

--pct-syskeys Adjust percentage of "system" key events. (These are keys that are generally reserved for use by the system, such as Home, Back, Start Call, End Call, or Volume controls.) More options at http://developer.android.com/tools/help/monkey.html

like image 125
Thupten Avatar answered Apr 02 '26 20:04

Thupten



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!