How to use Android terminal to grant permission - rascarlo/GranularImmersiveMode GitHub Wiki

If your device has root, you can use a terminal app to grant the permission. You can use Termux, it is awesome.

invoke su

Enter this command in a terminal session:

su

You should see a dialog asking for confirmation to grant superuser privileges to the terminal app. You should confirm.

Grant WRITE_SECURE_SETTINGS permission

Enter this command in a terminal session:

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