Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: adb: Permission Denied

Tags:

android

adb

Whatever I type after adb shell it fails with Permission denied:

D:\android-sdk-windows\platform-tools>adb shell find /data -name *.db find: permission denied  D:\android-sdk-windows\platform-tools>adb shell test test: permission denied  D:\android-sdk-windows\platform-tools>adb remount remount failed: No such file or directory 

Any ideas?

like image 858
Caner Avatar asked Sep 13 '11 08:09

Caner


People also ask

How do I get root permission from adb?

root access is disabled by system setting - enable in settings -> development options Once you activate the root option (ADB only or Apps and ADB) adb will restart and you will be able to use root from the cmd line.

How do I change permissions on adb shell?

Changing permissions We can change permissions of installed application by using the adb shell pm grant <package> <permission> or adb shell pm revoke <package> <permission> commands. To grant permissions(s) we can use the adb shell pm grant <package> <permission> command.


2 Answers

According to adb help:

adb root                     - restarts the adbd daemon with root permissions 

Which indeed resolved the issue for me.

like image 188
Roman Avatar answered Sep 19 '22 09:09

Roman


Without rooting: If you can't root your phone, use the run-as <package> command to be able to access data of your application.

Example:

$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/

exec-out executes the command without starting a shell and mangling the output.

like image 36
Fabian Zeindl Avatar answered Sep 20 '22 09:09

Fabian Zeindl