Android: adb: Permission Denied

2019-01-16 04:16发布

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?

标签: android adb
9条回答
劳资没心,怎么记你
2楼-- · 2019-01-16 04:27

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.

查看更多
Deceive 欺骗
3楼-- · 2019-01-16 04:27

data partition not accessible for non root user, if you want to access it you must root your phone.

adb root not work for all product and depend in phone build type.

in new version on android studio you can explore /data/data path for debuggable apps.

查看更多
疯言疯语
4楼-- · 2019-01-16 04:31

Solution for me was (thx to David Ljung Madison post)

  1. Root the phone & be sure it is rooted
  2. Adb server (adbd) was not run as root so downloaded & installed the adbd insecure app
  3. Restart adb adb kill-server
  4. Run it & worked like a flower!
查看更多
可以哭但决不认输i
5楼-- · 2019-01-16 04:32

Do adb remount. And then try adb shell

查看更多
冷血范
6楼-- · 2019-01-16 04:33

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.

查看更多
Root(大扎)
7楼-- · 2019-01-16 04:37

According to adb help:

adb root                     - restarts the adbd daemon with root permissions

Which indeed resolved the issue for me.

查看更多
登录 后发表回答