How to use ADB to grant permission - rascarlo/GranularImmersiveMode GitHub Wiki

You must have developer options and USB debugging enabled on the device.

Download the official package for your OS from the Android Developer Web site.

Extract the downloaded zip package.

Follow the steps for your OS:


Linux

Open a terminal session and follow 3 steps:

Check if the device is connected

If adb is not in your PATH, you should cd to the extracted folder.

Enter this command in a terminal session:

adb devices

You should see your device in the list of devices attached.

If the device is listed as unauthorized, check the device for a confirmation dialog.

Grant WRITE_SECURE_SETTINGS permission

Enter this command in a terminal session:

adb shell pm grant com.rascarlo.granular.immersive.mode android.permission.WRITE_SECURE_SETTINGS

Windows 10

Screenshots taken on a virtualbox with Windows 10.

Use the file manager to navigate to the folder where the zip package has been downloaded.

Extract the zip package.

Enter the folder of the extracted package.

Open PowerShell window here. You can use SHIFT+right click. Or you can search the internet if you like to read more about it.

This is the PowerShell window.

Enter the following command and hit ENTER:

.\adb devices

You should see your device in the list of devices attached.

If the device is listed as unauthorized, check the device for a confirmation dialog.

Enter the following command and hit ENTER:

.\adb shell pm grant com.rascarlo.granular.immersive.mode android.permission.WRITE_SECURE_SETTINGS


Official SDK Platform Tools is available for Windows, Mac and Linux here

WRITE_SECURE_SETTINGS permission documentation is available here

Android Device Bridge (adb) documentation is available here