调试检测装置(ADB)不工作

发布于 2024-11-17 08:44:47 字数 1381 浏览 0 评论 0原文

我已在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

苦笑流年记忆 2024-11-24 08:44:47

在某些情况下,您还必须将供应商 ID 添加到此文件中:~/.android/adb_usb.ini

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE. 
0x0e79

请注意,升级 SDK 时此文件可能会被覆盖,因此您可能需要重新编辑它然后。

In some cases you also have to add vendor id to this file: ~/.android/adb_usb.ini

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.
# USE 'android update adb' TO GENERATE.
# 1 USB VENDOR ID PER LINE. 
0x0e79

Mind that this file might be overwritten when you upgrade SDK, so you might need to re-edit it afterwards.

寒尘 2024-11-24 08:44:47

Mageia 2

起初,我得到了类似的信息:

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

然后我发现我需要做设置|应用 |开发并选中 USB 调试复选框。

$ adb devices
List of devices attached 
???????????????? no permissions

以 root 身份尝试,我得到:

$ su -l
# adb devices
List of devices attached 
???????????????? no permissions

然后我意识到 adb 仍在以普通用户身份运行。当我以 root 身份执行以下操作时:

# adb kill-server
# adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 offline

ADB for Android Developers (ARCHOS Internet Tablet)很有帮助,除了我最终以 root 身份执行此操作:

# cat /etc/udev/rules.d/51-android.rules 
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",
SUBSYSTEM=="usb", ENV{PRODUCT}=="e79/*", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="e79", MODE="0666"
# udevadm control --reload-rules
# udevadm monitor
.
.
.
^C

监视命令很有帮助,因为它显示设备连接、断开连接、路径等。

然后我能够停止以 root 身份运行的服务器,并以普通用户身份启动它:

# adb kill-server
# exit
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 offline

该设备将无法工作,当“离线”。为了解决这个问题,我必须重新启动 Archos 43。

$ adb devices
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 device

虽然我怀疑是否需要执行这些操作,但为了安全起见,重新启动后,我确保在打开 USB 调试之前插入 USB 并选择仅充电。我还禁用了 WiFi 和同步,但是一旦它开始工作,adb 仍然会与那些打开的连接。

此时,下载我的应用程序可以正常工作:

$ adb install bin/HelloWorld.apk 
2914 KB/s (157589 bytes in 0.052s)
        pkg: /data/local/tmp/HelloWorld.apk
Success

PS 第二天,我知道前一天晚上一切正常,因此启动了我的开发系统并尝试再次连接。这给出了“离线”状态。我禁用了同步和 WiFi,没有重新启动 Archos 43,然后 adb devices 显示“设备”状态而不是“离线”。我不知道该怎么做,但关闭这些东西毕竟可能具有重要意义。

Mageia 2

At first, I got something like:

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

Then I found I needed to do Settings | Applications | Development and Check the USB Debugging check box.

$ adb devices
List of devices attached 
???????????????? no permissions

Trying as root, I got:

$ su -l
# adb devices
List of devices attached 
???????????????? no permissions

Then I realized that adb was still running as regular user. When, as root, I did:

# adb kill-server
# adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 offline

ADB for Android Developers (ARCHOS Internet Tablet) was helpful, except I ended up doing this as root:

# cat /etc/udev/rules.d/51-android.rules 
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device",
SUBSYSTEM=="usb", ENV{PRODUCT}=="e79/*", MODE="0666"
SUBSYSTEM=="usb", SYSFS{idVendor}=="e79", MODE="0666"
# udevadm control --reload-rules
# udevadm monitor
.
.
.
^C

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:

# adb kill-server
# exit
$ adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 offline

The device will not work when "offline". To fix that I had to reboot the Archos 43.

$ adb devices
List of devices attached 
A43-A44C0002-9BF80000-0C60C4CC-0D020027 device

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:

$ adb install bin/HelloWorld.apk 
2914 KB/s (157589 bytes in 0.052s)
        pkg: /data/local/tmp/HelloWorld.apk
Success

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.

却一份温柔 2024-11-24 08:44:47

执行命令 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.

温柔一刀 2024-11-24 08:44:47

我从 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!

白鸥掠海 2024-11-24 08:44:47

事实上,就像 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).

豆芽 2024-11-24 08:44:47

我使用的是 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. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文