Home > Tips and Tricks > Android

ADB Shell “Error: no permission specified” [Fixed]

In this guide, we will show you the steps to fix the ADB Shell “Error: no permission specified” error. There are a few third-party apps out there that require elevated permissions but could still run without root. You just need to grant them the required permissions via the adb shell commands and that’s just about it. However, that might prove to be easier said than done in some cases. For instance, a user wants to give Tasker permission to read the logs on his Android device.

However, upon executing the adb shell pm grant net.dinglisch.android.taskerm.android.permission.READ_LOGS command, he is instead being greeted with the “Error: no permission specified”. And this isn’t just a one-off instance, we came across many reports of this issue affecting various third-party apps. So wherein lies the problem and more importantly how to rectify it? Let’s find out.

Fix ADB Shell “Error: no permission specified”

ADB Shell "Error: no permission specified"

The issue isn’t with the third-party app but rather it’s related to an error in the typed command. The correct syntax to grant permissions to an app via ADB shell is as follows:

adb shell pm grant <app_package_name> android.permission.<permission_name>

So in the above example, the app package name is net.dinglisch.android.taskerm and we are giving it permission to read the logs, i.e. READ_LOGS, so the aforementioned command will transform to:

adb shell pm grant net.dinglisch.android.taskerm android.permission.READ_LOGS

Likewise, let’s take another example, this time from the Better Battery Stats app. Its app package name is com.asksven.betterbatterystats and it wants to get access to your device’s battery stats. So here’s what the command should look like:

adb shell pm grant com.asksven.betterbatterystats android.permission.BATTERY_STATS

Upon following the above syntax, you will no longer get the ADB Shell “Error: no permission specified” error. Some Android devices such as OnePlus and Xiaomi might give out an “Exception occurred while executing grant” error, In that case, you’ll have to disable Permission Monitoring in OnePlus and MIUI Optimization as well as USB Debugging (Security Settings) in Xiaomi. Here’s the detailed guide on the same: Fix Exception occurred while executing grant [Video].

ADB Shell Error: no permission specified

So on that note, we round off this guide. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share: