0

I'm trying to make some apps on my phone to NOT run in the background. I tried from https://stackoverflow.com/a/52707377/5884503:

lz@vm:~/Android/Sdk/platform-tools$ ./adb shell cmd appops set package:com.whatsapp RUN_IN_BACKGROUND ignore
Error: No UID for package:com.whatsapp in user 0

How can I make whatsapp (and others) to not run in the background?

Gatonito
  • 1,662
  • 5
  • 26
  • 55

2 Answers2

1

You should run it like ./adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND ignore i.e. without package:

ant0nk
  • 134
  • 1
  • 7
1

Try Like This

cmd appops set <package_name> RUN_IN_BACKGROUND ignore

in your case

adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND ignore