How to Grant Permissions Using ADB in Android
It can be tricky to grant advanced permissions to Android apps without rooting your phone. Here's how you can use ADB to achieve it.
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.
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.
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.
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.
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.
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.
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 (./)
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.
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.
Now, type the following command in PowerShell or Terminal:
Finally, you can use this command to grant permissions to any app using ADB:
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.
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.
Rishabh is a staff writer at MakeUseOf (MUO), specializing in Windows technology. He joined MUO in 2022 and has since been creating how-to guides on Windows troubleshooting, apps, and its new features. His interests extend to Android OS, artificial intelligence, cyber security services, and productivity tools like Office 365.Currently, he's pursuing Bachelor of Commerce (BCom Hons.) from Panjab University, India. In his free time, he explores the world of custom ROMs and kernels.
SDK Platform-Toolsplatform-toolsOpen PowerShell window hereOpen in Terminalplatform-toolsFinder > Services > New Terminal at FolderSettings > About phoneBuild numberSettings > SystemUSB debugging.OK./Allow USB debuggingAlways allow from this computerAllow<package-name><permission>com.paget96.batteryguruAndroid.permission.PACKAGE_USAGE_STATS