Reputation: 105
my app uses accessibility permission and every time i run it i need to grant the permission manually , it is tedious, is there an option to grant my app this permission, by some command ,just for debug purposes? Thank you.
Upvotes: 4
Views: 5376
Reputation: 988
I found this post which looks like the same thing: Accessibility Service is turned off automatically on each Run since Android studio 3.5
It references an issue to track this: https://issuetracker.google.com/issues/140056246
Upvotes: 1
Reputation: 1697
There is, although I'm not sure if you need to do it as the root user. Try this command.
adb shell settings put secure enabled_accessibility_services %accessibility:packagename/packagename.YourAccessibilityServiceName
Keep in mind that if you have applicationIdSuffix for your debug build this command becomes
adb shell settings put secure enabled_accessibility_services %accessibility:packagename.applicationIdSuffix/packagename.YourAccessibilityServiceName
You can read more about the other secure settings you can modify using shell commands here.
Upvotes: 5