Android: adb: permission denied
Whatever I print after the "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?
According to adb help :
adb root - restarts the adbd daemon with root permissions Which really solved the problem for me.
The reason for the denial of access is due to the fact that your Android machine was not correctly implemented. Did you see $ after running adb shell ? If you rooted your machine correctly, you would see # .
If you see $ , try entering superuser mode by typing su . If Root is enabled, you will see # - without asking for a password.
No rooting . If you cannot connect your phone, use the run-as <package> command to access your application data.
Example:
$ adb exec-out run-as com.yourcompany.app ls -R /data/data/com.yourcompany.app/
exec-out executes the command without starting the shell and processing the output.
You may 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 After activating the root option (only ADB or Apps and ADB) adb will restart and you can use root from the cmd line.
Be careful with the slash, change "\" to "/", for example: adb.exe click SuperSU-v2.79-20161205182033.apk / storage
The data section is not accessible to a non-root user, if you want to access it, you must get root access to your phone.
adb root does not work for all products and depends on the type of phone assembly.
In the new version on Android Studio, you can explore /data/data path for debugged applications.
The solution for me was (thanks to David Ljung Madison post )
- Roots of the phone and make sure it is rooted
- Adb server (adbd) was not running as root, so I downloaded and installed the adbd insecure application
- Restart adb
adb kill-server - Launch it and work like a flower!
Make adb remount. And then try adb shell
Run your cmd as administrator, this will solve my problems. Thank you