I am new to using monkey on Android and from trying out a few examples I see it's spending most of its events on settings activity. It didn't matter which activity I started my tests from, it ended up just trying to make changes to my settings activity.
Is there a way I can force to monkey to avoid doing this and use it in a meaningful way?
You can use one or more -p <allowed-package-name>
in your command line to restrict the package names that will receive events. In that way you can exclude Stettings.
You can also use AndroidViewClient/culebra in concertina mode which lets you use a more clever approach. Instead of just generating a pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events to interact with the device it analyzes the content of the screen and randomly selects a suitable event or action for the also randomly selected target, normally a View
.
One very interesting case is if the content description suggest the application may be awaiting for you to talk, like Tap to Speak or Voice Search, culebra
will actually speak random text to the app (this feature is only available on Linux and OSX).
If the default configuration or random text, password and emails does not suit your needs you can change it in concertina.py
More details can be found at culebra: concertina mode