我的问题如下:
adb devices
>>> ???????????? 没有权限sudo adb devices
>>>> sudo: adb: 找不到命令adb shell
>>> 错误:设备权限不足
$ 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的已root Moto Droid和运行基于CM7的ROM的已root G-Tab得到了相同的结果。
我查看了以下相关帖子:
- http://forum.xda-developers.com/archive/index.php/t-522827.html
- http://ubuntuforums.org/archive/index.php/t-1164359.html
- 在Linux环境中找不到adb命令
我尝试了大部分(不是全部)建议,但无法解决我的问题。我没有尝试的那些方法似乎不合适。如果您能提供一些更多的提示,我将不胜感激,并继续排除故障。
我没有尝试的一件事是编辑/etc/udev/rules.d/70-android.rules。那可能是问题吗?我看不出那会导致“sudo:adb:command not found”。也许我的问题并非都相关。无论如何,现在我认为我需要其他人的意见,因为我不认为我有路径问题或其他帖子中讨论的常见问题。
编辑:问题已解决,感谢EboMike和RivieraKid。这实际上是两个不同的问题:
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
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.)
My other two items were resolved by implementing the udev rule as RivieraKid suggested (from this link).