Reputation: 59288
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?
Upvotes: 134
Views: 473563
Reputation: 467
The data
partition is not accessible for non-root users, if you want to access it you must root your phone.
ADB root
does not work for all product and depend on phone build type.
in the new version of android studio, you can explore /data/data
path for debuggable apps.
Android Studio new versions have some tools like Device Explorer
and App Inspection
to access application data. (app must be debuggable).
Upvotes: 5
Reputation: 1183
if you are looking to get /data/anr/ as I was, you can use an easy approach
adb bugreport
source: this answer
Upvotes: 1
Reputation: 173
None of the previous solutions worked for me but I was able to make it work using this command
adb shell "run-as com.yourcompany.app cat /data/data/com.yourcompany.app/shared_prefs/SHARED_PREF_PROTECTED.xml" > SHARED_PREF_PROTECTED.xml
Upvotes: 7
Reputation: 1735
Run your cmd
as administrator this will solve my issues.
Thanks.
Upvotes: -9
Reputation: 5988
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.
Upvotes: 67
Reputation: 2035
According to adb help
:
adb root - restarts the adbd daemon with root permissions
Which indeed resolved the issue for me.
Upvotes: 186
Reputation: 5093
Solution for me was (thx to David Ljung Madison post)
adb kill-server
Upvotes: -5
Reputation: 93173
You might need to activate adb root from the developer settings menu.
If you run adb root
from the cmd line you can get:
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.
Upvotes: 6
Reputation: 295
The reason for "permission denied" is because your Android machine has not been correctly rooted. Did you see $
after you started adb shell
? If you correctly rooted your machine, you would have seen #
instead.
If you see the $
, try entering Super User mode by typing su
. If Root is enabled, you will see the #
- without asking for password.
Upvotes: 27