On LineageOS how to set app *Allow background usage* with `adb`?
Jan 25, 5:04pm

To set an app's "Allow background usage" permission on LineageOS using ADB, you can use the following command:

bash
adb shell cmd appops set <package_name> RUN_IN_BACKGROUND allow

Replace <package_name> with the actual package name of the app you want to allow background usage for. For example, if you want to allow background usage for WhatsApp, you would use:

bash
adb shell cmd appops set com.whatsapp RUN_IN_BACKGROUND allow

This command will enable the app to run in the background, which corresponds to the "Allow background usage" setting in the UI.

If you want to restrict background usage instead, use:

bash
adb shell cmd appops set <package_name> RUN_IN_BACKGROUND ignore

This is the standard ADB method for controlling background app restrictions on Android, including LineageOS.

Jan 25, 5:04pm

This Chat is read-only. Login to resume chatting.