adb devices 命令不起作用 [英] adb devices command not working

查看:61
本文介绍了adb devices 命令不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Ubuntu 10.10 64 位.我安装了 ia32-libs 和 Android Debug Bridge 1.0.26 版.

I'm running Ubuntu 10.10 64 bit. I have ia32-libs installed along with Android Debug Bridge version 1.0.26.

我的问题:

  1. adb devices >>> ????????????没有权限
  2. sudo adb devices >>>> sudo: adb: command not found
  3. adb shell >>> 错误:设备权限不足
  1. adb devices >>> ???????????? no permissions
  2. sudo adb devices >>>> sudo: adb: command not found
  3. adb shell >>> error: insufficient permissions for device

我想这些都是相关的.这是相关信息.

I guess these are all related. Here's the relevant info.

$ echo $PATH
/home/me/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/android-sdk-linux_x86/tools:/opt/android-sdk-linux_x86/platform-tools

$ which adb
/opt/android-sdk-linux_x86/platform-tools/adb

$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
????????????    no permissions

$ sudo adb devices
sudo: adb: command not found

$ adb shell
error: insufficient permissions for device

对于运行 CM6.1 的有根 Moto Droid 和运行基于 CM7 的 ROM 的有根 G-Tab,我得到了相同的结果.

I get the same results with a rooted Moto Droid running CM6.1 and a rooted G-Tab running a CM7-based ROM.

我已查看以下相关帖子:

I have reviewed the following related posts:

我尝试了大部分(不是全部)建议,但未能解决我的问题.我没有尝试的事情似乎不合适.如果您提供更多提示,我将不胜感激,我会继续进行故障排除.

I tried most (not all) of the suggestions and I have not been able to resolve my issue. The things I didn't try seemed inappropriate. I would appreciate a few more tips and I'll keep troubleshooting.

我没有尝试的一件事是编辑/etc/udev/rules.d/70-android.rules.这可能是问题吗?我看不出这将如何导致sudo: adb: command not found".也许我的问题并不都是相关的.无论如何,在这一点上,我认为我需要其他人的一些意见,因为我认为我没有路径问题或其他帖子中讨论的其他常见问题.

One thing I didn't try was editing /etc/udev/rules.d/70-android.rules. Is that likely to be the issue? I can't see how that would cause "sudo: adb: command not found". Maybe my problems are not all related. Anyway, at this point I think I need some input from other people because I don't believe I have a path problem or the other common problems discussed in those other posts.

已解决 感谢 EboMike 和 RivieraKid.这实际上是两个不同的问题:

SOLVED thanks to EboMike and RivieraKid. This was actually two different problems:

  1. 上面的第 2 项(sudo: adb: command not found)是通过创建如下符号链接解决的:

  1. Item #2 above (sudo: adb: command not found) was solved by making a symlink as follows:

$ sudo ln -s /opt/android-sdk-linux_x86/platform-tools/adb /usr/local/sbin/adb

这让我可以按照 EboMike 的建议去做并使用这个解决方案.我的 Moto Droid 需要这样做.(不过,我的 Viewsonic G-Tablet 不需要将 adb 作为 sudo 运行.)

That allowed me to then do as EboMike suggested and use this solution. Doing that was required for my Moto Droid. (Running adb as sudo was not required for my Viewsonic G-Tablet, however.)

我的另外两个项目是通过实施 RivieraKid 建议的 udev 规则解决的(来自这个 link).

My other two items were resolved by implementing the udev rule as RivieraKid suggested (from this link).

推荐答案

我没有尝试的一件事是编辑/etc/udev/rules.d/70-android.rules.是这可能是问题所在?

One thing I didn't try was editing /etc/udev/rules.d/70-android.rules. Is that likely to be the issue?

您没有这样做的任何特殊原因?回答这个问题 - 是的!udev 规则通知 Ubuntu 你的设备是什么,并允许用户空间工具访问它.

Any particular reason why you didn't do that? To answer the question - YES! The udev rules are what informs Ubuntu what your device is and allows user-space tools to therefore access it.

如果不正确遵循说明,您将无法使用 adb.

You will not be able to use adb without correctly following the instructions.

但是,考虑到这一点,您没有说明您使用的是哪个版本的 Ubuntu,但我在 10.10 上遇到了问题 - 如果您需要我发布规则文件的内容,请告诉我.

With that in mind however, you don't say what version of Ubuntu you're using but I had issues with 10.10 - let me know if you need me to post the contents of my rules file.

不要担心通过 sudo 运行 adb,你不需要它.udev 规则中的 MODE="0666" 允许您以任何用户的身份访问设备.

Don't worry about running adb via sudo, you don't need it. The MODE="0666" from the udev rule allows you to access the device as any user.

不要忘记重新加载规则:

Don't forget to reload the rules:

sudo udevadm control --reload-rules

编辑#2:

正如@Jesse Glick 正确指出的那样,如果 adb 已经在守护进程模式下运行,您还需要重新启动它才能使其工作:

As @Jesse Glick correctly points out, if adb is already running in daemon mode, you'll also need to restart it for this to work:

sudo adb kill-server

我在这里使用了 sudo ,因为这将保证 adb 将被杀死,并且它是官方支持的停止服务器的方法.下次使用 adb 时会自动重启,但这次使用正确的环境.

I've used sudo here, since that will guarantee that adb will be killed , and it's the officially supported method to stop the server. It will be automatically restarted the next time adb is used, but this time with the correct environment.

这篇关于adb devices 命令不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆