I'm trying to use Monkey debuggin tool (from adb) to stress test a part of my application. As Monkey acts in a total random way, I'd like it to concentrate on the part of code that might contain an error I'm looking for (very rare bug, and I don't know how to replicate it).
So, in my Main activity I have 6 buttons, each fires up a new activity. I'd like to set monkey to look only in one of those activities, and every activity accesible from it. I cannot find a reasonable way to do it.
I've tried the
adb shell monkey -p my.package.name -c android.intent.category.MONKEY 1000
and in my manifest file I've put in some activities, that I'm interested in:
<intent-filter>
<category android:name="android.intent.category.MONKEY"/>
</intent-filter>
But it didn't work. Monkey still fires up activities that are not categorized by this tag. It is crucial for Monkey to work in selected subactivities, because it wastes about 95% of time roaming through my app, outside of subactivities that I actually want to test.
Also I've tried some simple script to launch the desired subactivity, but with no success.
Looking for any help,
cheers,
kajman
I have also had a bit of problems with constraining the monkey with categories. I think it is not intended to work as you assume. How it works then? I have no clear idea, just experimenting with it. The documentation is quite poor.
For your problem you could consider the following approaches
P.S. You can use adb shell am start in order to start the desired subactivity. Again poor documentation, no example, but the action is the name of the action you have defined inside intent-filter for the activity in your AndroidManifest. Name is the Activity name, for example
I know it is bit late but here is more robust way - use code like this: