Most Android apps can easily ask for basic permissions like storage or camera access. However, some apps require system-level permissions to function properly.

While you can overcome this by rooting your phone, that's a complicated and sometimes unnecessary process. Instead, you can grant advanced permissions using ABD commands.

In this article, we're going to explain what ADB is and how to use it to grant permissions on Android.

What Is Android Debug Bridge (ADB)?

In Android, normal users often can't perform system-protected tasks such as removing unwanted pre-installed apps without advanced techniques, like altering the operating system files through rooting. This is where ADB (Android Debug Bridge) comes in.

ADB is a command-line tool by which you can connect an Android device to a computer to perform those tasks that typically require root. You can use various useful ADB commands to uninstall system apps, install APK files, take system logs, grant additional permissions to apps, and more.

How to Grant Permissions Over ADB

Before using the commands, you need to set up an ADB connection with your device. Using Windows, Mac, or Linux makes almost no difference, as the ADB commands are the same for all operating systems.

However, Windows users will use PowerShell, while Mac and Linux users need to use a terminal or shell to execute the ADB commands.

Step 1: Download the SDK Tool

Visit the Android Developers website and download the SDK Platform-Tools file for your operating system. It downloads as a ZIP file. Once it is done, browse to the folder where you saved the file and extract it.

download sdk platform tools for android

Step 2: Open PowerShell or the Terminal

Open the platform-tools folder you just extracted. On Windows 10, hold Shift and right-click in the folder and select Open PowerShell window here, or on Windows 11, just right-click and select Open in Terminal.

If you're on Linux or Mac, you have to open a Terminal in the same folder where the contents of the platform-tools folder are stored. To do this on a Mac, open the folder and go to Finder > Services > New Terminal at Folder in the menu bar.

Step 3: Enable Developer Options and USB Debugging

Now, you need to enable Developer Options on your smartphone, if you haven't already. To do so, go to Settings > About phone and tap on the Build number (seven times). If it asks for a password, enter your lock screen password.

With that done, go to Developer Options (found at Settings > System on most phones) and enable USB debugging. Tap OK if prompted by a pop-up. Finally, connect your phone to your computer using a USB cable.

Step 4: Confirm the Device Connection

Type the command below in PowerShell or Terminal to check your device is successfully connected. On Linux and Mac, all commands must be preceded by a dot-slash (./)

adb devices

adb devices test

If you cannot see your device's unique serial number after entering the above command, it means something is wrong from your side. This happens mainly when your PC can't detect the ADB drivers on your device.

To fix this issue, download and install the universal drivers from the ClockworkMod website or download the latest version ADB installer from a post on the XDA forums.

If your issue persists, follow the steps in our guide to fixing ADB connection issues in Windows.

Step 5: Allow USB Debugging

If you're using ADB commands for the first time, after step four, a popup will appear on your phone to ask if you want to Allow USB debugging. Select the checkbox that says Always allow from this computer and tap Allow.

Step 6: Enter the ADB Commands

Now, type the following command in PowerShell or Terminal:

adb shell

setup adb shell

Finally, you can use this command to grant permissions to any app using ADB:

pm grant <package-name> <permission>

Replace <package-name> with the app's package name and <permission> with the required permission. The package name is different to the app name, so if you don't know what it is, you can download Package Name Viewer 2.0 and search for the app that needs advanced permission.

In our case, we are going to grant permission to the Battery Guru app.

In this example, com.paget96.batteryguru is the package name and Android.permission.PACKAGE_USAGE_STATS is the permission we want to grant. This searches for the BatteryGuru app and grants access to see usage and statistics.

pm grant com.paget96.batteryguru android.permission.PACKAGE_USAGE_STATS

Get More Control Over Android With ADB

No doubt, ADB is a great tool for a host of helpful things. Not only does it help you grant app permissions, but you can also back up your system data without root.

Once you delve into the power of ADB, you'll begin to understand and enjoy the versatility of the Android environment.