ADB Setup Guide
What is this guide for?
To enable toggling system settings like Mobile Data, Location, Airplane Mode, Bottom Status Bar etc from quick settings tiles, you'll need to grant a permission via ADB (Android Debug Bridge). This guide provides step-by-step instructions.
What You Need
- A USB cable to connect your phone to your computer
- ADB installed on your computer (instructions below)
Step-by-Step Instructions
Enable Developer Options
On your phone, go to Settings → About phone. Tap 'Build number' 7 times until you see 'You are now a developer!'. This unlocks the Developer Options menu.
Enable USB Debugging
Go to Settings → System → Developer options (or Settings → Developer options on some devices). Scroll down and enable 'USB debugging'.
Download and Install ADB
If you don't have ADB installed, download the Android SDK Platform Tools from the Android developer website [test](https://developer.android.com/tools/releases/platform-tools).
Connect Your Phone
Connect your phone to your computer using the USB cable. Make sure to allow USB debugging on your phone when prompted. You may need to change the USB connection mode to 'File Transfer'.
Verify ADB Connection
Open a terminal/command prompt on your computer and run the following command in the same folder where ADB (adb.exe) is installed to verify your device is connected:
adb devicesRun the ADB Command
Once connected, copy and paste the following command into your terminal to grant the permission:
adb shell pm grant com.tombayley.miui android.permission.WRITE_SECURE_SETTINGSVerify the Permission
After running the command, you should see no output (which means success). You can now toggle system settings from the app!
Troubleshooting
If you are getting a SecurityException grantRuntimePermission error and are using MIUI, make sure all options for USB debugging are enabled (specifically 'USB debugging (Security Settings)').