Search code examples
androidmonkeyrunner

monkeyrunner script - starting an activity that requires a permission


in a monkeyrunner script while launching an activity, is there a way to mimic yourself having a certain permission that the starting activity requires?

I am using "device.startActivity(component='com.package/.MyActivity)" but the activity MyActivity requires a permission, and hence device.startActivity fails. Is there a way to give this permission to the script?


Solution

  • When I had this problem, I solved it by creating a very small application(with the correct permissions in the manifest) that I pushed to the phone. All the application did was re-send intents sent to it, but to a different destination. My application also had a gui for triggering events manually, but that's optional.