Sometimes the Android Settings UI feels slow, especially when you need to tweak permissions for dozens of apps or for a newly installed app that immediately asks for access you don’t want to grant. ADB (Android Debug Bridge) lets you change permissions directly from your computer, without rooting the device. This tutorial walks you through the entire workflow: preparing your PC, connecting the phone, listing permissions, and safely granting or revoking them.
Android’s runtime permission model (introduced in Android 6.0 Marshmallow) stores each grant in a system database. The UI only exposes a subset of that data, and it can be cumbersome to repeat the same steps for many apps. ADB gives you:
android.permission.READ_CALL_LOG).All of this works on stock Android and on most OEM skins, as long as you have USB debugging enabled. No root, no custom recovery, and no third‑party apps required.
Make sure you have a recent backup of any important data. Changing permissions can cause an app to misbehave or crash if it suddenly loses a required permission.
adb (part of the Android SDK Platform‑Tools).C:\adb on Windows or ~/adb on macOS/Linux).PATH so you can run adb from any terminal.
setx PATH "%PATH%;C:\adb"export PATH="$PATH:$HOME/adb" to ~/.bash_profile or ~/.zshrc.adb version. You should see something like Android Debug Bridge version 1.0.41.adb devices. You should see a line like:
0123456789ABCDEF device
unauthorized, check the phone for the debugging dialog and grant permission.adb with adb kill-server && adb start-server.ADB works with the app’s package identifier (e.g., com.whatsapp). You can find it in several ways:
https://play.google.com/store/apps/details?id=com.whatsapp.adb shell pm list packages | grep -i partial_name
Replace partial_name with a keyword like whatsapp.
PACKAGE_NAME with the real identifier:
adb shell dumpsys package PACKAGE_NAME | grep granted=true
android.permission.CAMERA: granted=true
android.permission.READ_CONTACTS: granted=true
android.permission.ACCESS_FINE_LOCATION).Use the pm grant command. This works for “dangerous” runtime permissions and for many “normal” permissions that the UI can’t toggle.
adb shell pm grant PACKAGE_NAME android.permission.PERMISSION_NAME
Replace PACKAGE_NAME and android.permission.PERMISSION_NAME accordingly.
adb shell pm grant com.example.weather android.permission.ACCESS_FINE_LOCATION
Reversing a grant is equally simple with pm revoke.
adb shell pm revoke PACKAGE_NAME android.permission.PERMISSION_NAME
adb shell pm revoke com.social.app android.permission.CAMERA
granted=false or disappear entirely.appops for special casesSome permissions are controlled by the appops subsystem (e.g., android.permission.SYSTEM_ALERT_WINDOW or android.permission.WRITE_SETTINGS). The pm commands won’t affect them.
adb shell appops get PACKAGE_NAME OP_NAME
Example:
adb shell appops get com.example.overlay SYSTEM_ALERT_WINDOW
adb shell appops set PACKAGE_NAME OP_NAME allow
allow with ignore.
adb shell appops set com.example.overlay SYSTEM_ALERT_WINDOW ignore
appops are not reflected in the Settings UI, but the app will respect them immediately.Most apps react instantly, but a few cache their permission state. To be safe:
adb shell am force-stop PACKAGE_NAME.If the feature works (or stops working after a revoke), the command succeeded.
When you have many apps to adjust, a short shell script can save time. Below is a minimal example for a Unix‑like shell:
#!/bin/bash
# grant‑location.sh – grant location to a list of packages
PACKAGES=(
"com.example.map"
"com.weather.app"
"com.social.checkin"
)
for PKG in "${PACKAGES[@]}"; do
echo "Granting location to $PKG"
adb shell pm grant "$PKG" android.permission.ACCESS_FINE_LOCATION
done
Save as grant-location.sh, make it executable (chmod +x grant-location.sh), and run it while the device is connected.
The device is likely running Android 10+ with Scoped Storage or a manufacturer‑added restriction that blocks pm for non‑system apps. In that case:
adb root, which is unavailable on production devices.appops approach for the specific permission.On some OEM skins (e.g., certain versions of Xiaomi’s MIUI), the permission database is refreshed on boot. To make changes persistent:
adb script and add it to your PC’s startup routine.appopsMake sure you typed the exact operation name. Use adb shell appops list to see all supported ops. If the operation is still denied, the device may have a vendor‑level policy that cannot be overridden without root.
READ_CONTACTS) to an untrusted app may expose personal data. Only grant what you truly need.adb shell pm grant on a package you do not recognize – it could be a hidden component of malware.If you only need to adjust one or two permissions, the Settings UI is quicker and provides a visual confirmation. Use ADB when you:
SYSTEM_ALERT_WINDOW).With the steps above you can confidently grant or revoke any runtime permission on a non‑rooted Android device using ADB. The workflow is repeatable, scriptable, and works across most manufacturers and Android versions. Keep a short cheat‑sheet of the most common permission strings you use, and you’ll spend less time navigating menus and more time using your phone the way you want.









