Reputation: 6641
The Android Developers website suggests that we try out running our applications without implicit broadcasts and background services. For this, they've mentioned the following command here
adb shell cmd appops set RUN_IN_BACKGROUND ignore
However, when I try running it on my machine, I get the following error -
Error: Unknown operation string: ignore
Has anyone been able to make it work?
Upvotes: 1
Views: 812
Reputation: 6641
I found the solution to this one by looking at the source code of AppOpsCommand.
You need to give the package name of the app, and it will work -
adb shell cmd appops set <PACKAGE> RUN_IN_BACKGROUND ignore
Upvotes: 2