LogcatReader icon indicating copy to clipboard operation
LogcatReader copied to clipboard

Set permission

Open tbee opened this issue 7 years ago • 6 comments

Running the adb command to set the permission results in a 'no permission specified' error. Google seems to agree with the command itself, so I suspect a wrong id?

tbee avatar Aug 04 '18 07:08 tbee

Hmm... it should work. Are you sure you didn't misspell anything? adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS

Also, what version of Android?

darshanparajuli avatar Aug 04 '18 19:08 darshanparajuli

I presume the error was misreading the command. It appears as 3 lines when displayed by the app, given my screen resolution and font size. It is really all on a single line. Here a slight alternative: Open a DOS window by pressing the "Windows" key then typing "cmd" then enter. Use "cd /folder_to_adb.exe" Type "adb devices" If your phone is recognized; Type "adb shell" and enter

You are now in an interactive linux style shell executing in your phone. Type: "pm grant com.dp.logcatapp android.permission.READ_LOGS"

pm is a command which will read 3 parameters grant is the first parameter com.dp.logcatapp is the second parameter. It is the internal name that identify the app Finally, the third parameter is the name of the permission.

This works without needing root. The app, after restart, immediately print all those log lines. Thanks for sharing the source code.

Joust6809 avatar Dec 28 '18 08:12 Joust6809

Do I have to restart the app or my device? Is there a possibility to show in Logcat Reader if READ_LOGS is already granted?

I sent the command with adb and got no error, so I guess it worked. But Logcat doesn't show logs from other apps.

Huawei P20 Pro with Android 9.

marco-dev avatar Nov 17 '19 16:11 marco-dev

same issue with Motorola G7 here

$ adb shell dumpsys package com.dp.logcatapp | grep permission                                                             

    requested permissions:
      android.permission.READ_LOGS
      android.permission.READ_EXTERNAL_STORAGE
      android.permission.WRITE_EXTERNAL_STORAGE
      android.permission.FOREGROUND_SERVICE
    install permissions:
      android.permission.FOREGROUND_SERVICE: granted=true
      android.permission.READ_LOGS: granted=true
      runtime permissions:

You need to kill the app and restart it too :

adb shell  am force-stop com.dp.logcatapp

revolunet avatar Feb 04 '20 22:02 revolunet

adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS

Brock721 avatar Jan 19 '22 02:01 Brock721

Hmm... it should work. Are you sure you didn't misspell anything? adb shell pm grant com.dp.logcatapp android.permission.READ_LOGS

Also, what version of Android?

Thanks, I had the same error and thanks to your example I realized that my error was due to the missing space between the package name and the word "android..."

seand93 avatar Apr 08 '24 00:04 seand93