1

In Android monkey test, I must exclude some activities that I don't want to test.

I try to set ActivityLifecycleCallbacks on all Activities, and call finish() in onActivityCreated, onActivityStarted and onActivityResumed with some Activities I don't want to test. But sometimes it's still not working.

Could I add these Activities into something like blacklist? Thanks!

yuriel
  • 91
  • 1
  • 7
  • http://stackoverflow.com/questions/34059538/how-to-prevent-entering-settings-when-using-monkey-test/34917776 – Reetpreet Brar Feb 22 '17 at 11:22
  • Thanks for the link, but it's a way to add a package to blacklist. I think there is no way to add an Activity to blacklist. – yuriel Feb 23 '17 at 07:48

1 Answers1

0

There is also one option : -c

If you specify one or more categories this way, the Monkey will only allow the system to visit activities that are listed with one of the specified categories. If you don't specify any categories, the Monkey will select activities listed with the category Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c option multiple times — one -c option per category.

You can try this to choose activities you want to visit

https://stuff.mit.edu/afs/sipb/project/android/docs/tools/help/monkey.html