调试检测装置(ADB)不工作
我已在 Archos 43 互联网平板电脑 (Android 2.3.26) 上打开 USB 调试,但 adb 未检测到该设备。
我有 Kubuntu 11.04。
shell 命令“lsusb”的输出:
michael@schlepptop777:~/.android_sdk/platform-tools$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e79:1411 Archos, Inc.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
所以我的“供应商 ID”是 0e79,不是吗?
对于下一步,我创建了以下文件:
sudo kate /etc/udev/rules.d/51-android.rules
包含以下内容:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0e79", MODE="0666"
之后我设置了权限:
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
然后我保存了它并重新启动了 udev:
sudo /etc/init.d/udev restart
完成所有这些步骤后,adb 仍然不显示我的设备:
michael@schlepptop777:~/.android_sdk/platform-tools$ ./adb devices
List of devices attached
<empty line, because stackoverflow does not display this>
I've turned USB debugging on on my Archos 43 Internet Tablet (Android 2.3.26), but adb does not detect the device.
I have Kubuntu 11.04.
Output of shell command "lsusb":
michael@schlepptop777:~/.android_sdk/platform-tools$ lsusb
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 002: ID 0e79:1411 Archos, Inc.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
So my "Vendor ID" is 0e79, isn't it?
For the next step I've created the following file:
sudo kate /etc/udev/rules.d/51-android.rules
with the following content:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0e79", MODE="0666"
After that I've set the permissions:
sudo chmod a+rx /etc/udev/rules.d/51-android.rules
Then I've saved it and restarted udev:
sudo /etc/init.d/udev restart
And after doing all that steps adb still does not display my device:
michael@schlepptop777:~/.android_sdk/platform-tools$ ./adb devices
List of devices attached
<empty line, because stackoverflow does not display this>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在某些情况下,您还必须将供应商 ID 添加到此文件中:
~/.android/adb_usb.ini
请注意,升级 SDK 时此文件可能会被覆盖,因此您可能需要重新编辑它然后。
In some cases you also have to add vendor id to this file:
~/.android/adb_usb.ini
Mind that this file might be overwritten when you upgrade SDK, so you might need to re-edit it afterwards.
Mageia 2
起初,我得到了类似的信息:
然后我发现我需要做设置|应用 |开发并选中 USB 调试复选框。
以 root 身份尝试,我得到:
然后我意识到 adb 仍在以普通用户身份运行。当我以 root 身份执行以下操作时:
ADB for Android Developers (ARCHOS Internet Tablet)很有帮助,除了我最终以 root 身份执行此操作:
监视命令很有帮助,因为它显示设备连接、断开连接、路径等。
然后我能够停止以 root 身份运行的服务器,并以普通用户身份启动它:
该设备将无法工作,当“离线”。为了解决这个问题,我必须重新启动 Archos 43。
虽然我怀疑是否需要执行这些操作,但为了安全起见,重新启动后,我确保在打开 USB 调试之前插入 USB 并选择仅充电。我还禁用了 WiFi 和同步,但是一旦它开始工作,adb 仍然会与那些打开的连接。
此时,下载我的应用程序可以正常工作:
PS 第二天,我知道前一天晚上一切正常,因此启动了我的开发系统并尝试再次连接。这给出了“离线”状态。我禁用了同步和 WiFi,没有重新启动 Archos 43,然后
adb devices
显示“设备”状态而不是“离线”。我不知道该怎么做,但关闭这些东西毕竟可能具有重要意义。Mageia 2
At first, I got something like:
Then I found I needed to do Settings | Applications | Development and Check the USB Debugging check box.
Trying as root, I got:
Then I realized that adb was still running as regular user. When, as root, I did:
ADB for Android Developers (ARCHOS Internet Tablet) was helpful, except I ended up doing this as root:
The monitor command was helpful because it showed the device connects, disconnects, paths, etc.
I was then able to stop the server running as root, and start it as a regular user:
The device will not work when "offline". To fix that I had to reboot the Archos 43.
Though I doubt that these actions were required, to play it safe, after rebooting, I made sure to plug in the USB and select Charge Only before I set USB Debugging on. I had also disabled WiFi and Syncing, but once it started working, adb would still connect with those being on.
At this point, downloading my app worked:
P.S. The next day, knowing that everything worked the night before, I booted up my development system and tried to connect again. This gave the "offline" status. I disabled sync and WiFi, without rebooting the Archos 43, and then
adb devices
showed "device" status instead of "offline". I am not sure what to make of that, but turning this stuff off could have significance after all.执行命令
sudo /etc/init.d/udev restart
后,您必须重新启动系统!我知道,这听起来像是 Windows 的行为,但我花了 3 个小时才发现这个东西。
After doing the command
sudo /etc/init.d/udev restart
you have to reboot the system!I know, it sounds like a windows behaviour, but I broke my head for 3 hours before discovering this thing.
我从 SD 卡读卡器借了一根电缆,它不适用于 adb,但它适用于 SD 卡读卡器。
我尝试了一条新电缆,发现 adb devices 识别了该设备!
I borrowed a cable from an sd card reader and it wasn't working for adb, whilst it worked for the sd card reader.
I tried a new cable and low and behold adb devices recognises The device!
事实上,就像 Aultbot 一样,更换电缆也对我起到了作用。奇怪的是,我已经使用该电缆几个小时了,突然它无法与 ADB 一起使用。
另外,请确保您接受手机上的连接(Android 4 中的新安全功能)
编辑:最近,出现了一些有关 adb 服务的问题。如果它未启动(在运行 adb 命令以获取调试消息之前使用 netstat 或类似工具进行检查或键入“set ADB_TRACE=1”),则检查处理该错误消息的线程。一个常见问题是默认端口已被其他应用程序使用(通过在 adb 命令之前键入“set ANDROID_ADB_SERVER_PORT=12345”来更改端口)。
Actually, just like Aultbot, replacing the cable did the trick for me as well. Strange as I had been using the cable for several hours when it suddenly didn't work with ADB.
Also, make sure you accept the connection on the phone (new security function in Android 4)
Edit: Recently, there has been some issues regarding the adb service. If it is not started (check with netstat or similar or type "set ADB_TRACE=1" before running your adb command to get debug messages) then check threads dealing with that error message. A common issue is that the default port is in use by some other application (change port by typing "set ANDROID_ADB_SERVER_PORT=12345" before the adb command).
我使用的是 ubuntu 11.04,让 adb 连接到我的 Atrix 的唯一方法是将 USB 连接模式更改为“Windows Media Sync”。这首先很奇怪,但特别奇怪的是,当 Windows 上的 ADB 设置为赢得媒体同步时,它不会连接。
或者您可以使用无线 adb。有几个小部件可以非常轻松地启用 wifi adb。它们在小部件上显示 IP 地址和所有内容。 :)
I'm on ubuntu 11.04, the only way I can get adb to connect to my Atrix is by changing the USB connection mode to "Windows Media Sync". Which is odd in the first place, but it's especially odd because ADB on windows won't connect when it's set to win media sync.
Or you can use wireless adb. There's a couple widgets that make it really easy to enable wifi adb. They show the ip address on the widget and everything. :)