Android:adb:权限被拒绝
无论我在 adb shell
之后输入什么,它都会失败并显示 Permission returned
:
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
有什么想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(10)
根据
adb help
:这确实为我解决了这个问题。
According to
adb help
:Which indeed resolved the issue for me.
无需root:如果您无法root手机,请使用
run-as
命令来访问应用程序的数据。例子:
exec-out
执行命令而不启动shell 并修改输出。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:
exec-out
executes the command without starting a shell and mangling the output.“权限被拒绝”的原因是因为您的Android机器尚未正确root。启动
adb shell
后,您看到$
了吗?如果您正确地获得了计算机的 root 权限,您将会看到#
。如果您看到
$
,请尝试输入su
进入超级用户模式。如果启用 Root,您将看到#
- 无需输入密码。The reason for "permission denied" is because your Android machine has not been correctly rooted. Did you see
$
after you startedadb shell
? If you correctly rooted your machine, you would have seen#
instead.If you see the
$
, try entering Super User mode by typingsu
. If Root is enabled, you will see the#
- without asking for password.以前的解决方案都不适合我,但我能够使用此命令使其工作
None of the previous solutions worked for me but I was able to make it work using this command
您可能需要从开发人员设置菜单激活 adb root。
如果您从 cmd 行运行
adb root
,您可以得到:一旦激活 root 选项(仅限 ADB 或应用程序和 ADB),adb 将重新启动,您将能够从 cmd 行使用 root。
You might need to activate adb root from the developer settings menu.
If you run
adb root
from the cmd line you can get: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.
非root用户无法访问
data
分区,如果您想访问它,您必须root您的手机。ADB root
并不适用于所有产品,并且取决于手机构建类型。在新版本的android studio中,您可以探索可调试应用程序的
/data/data
路径。更新 2022
Android Studio 新版本提供了一些工具,例如
Device Explorer
和App Inspection
来访问应用程序数据。 (应用程序必须可调试)。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.update 2022
Android Studio new versions have some tools like
Device Explorer
andApp Inspection
to access application data. (app must be debuggable).如果您想像我一样获取 /data/anr/ ,您可以使用一个简单的方法
源:这个答案
if you are looking to get /data/anr/ as I was, you can use an easy approach
source: this answer
执行 adb 重新挂载。然后尝试 adb shell
Do adb remount. And then try adb shell
我的解决方案是(感谢 David Ljung Madison 帖子)
adb Kill-server
Solution for me was (thx to David Ljung Madison post)
adb kill-server
以管理员身份运行您的
cmd
这将解决我的问题。谢谢。
Run your
cmd
as administrator this will solve my issues.Thanks.