为什么 adb 在设备字符串之后返回离线?
我使用“adb devices”来获得以下结果。只有一台设备通过 USB 连接到 PC,但我们得到了 8 行结果。
有人能提出原因吗?
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
I use "adb devices" to get following result. Only one device is connected to PC by USB, but we get 8 lines of result.
Could anyone suggest the reason?
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
WH96TNE00361 offline
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
请尝试以下操作:
拔下 USB 插头,然后重新插回。
转到设置 ->应用->开发您的设备
并取消选中USB调试模式,然后再次选中它。
重新启动 PC 上的 adb。
adb 终止服务器
进而
adb start-server
重新启动您的设备并重试。
Try the following:
Unplug the usb and plug it back again.
Go to the Settings -> Applications -> Development of your device
and uncheck the USB debugging mode and then check it back again.
Restart the adb on your PC.
adb kill-server
and then
adb start-server
Restart your device and try again.
要完成前面的答案,另一个可能的解决方案是更改插入电缆的 USB 插座。
我遇到了这个问题(关于使用
adb Kill-server / start-server
的经典答案不是工作)并解决了它。实际上,我花了一些时间才发现这一点,因为 Windows 正确识别了我第一个插槽中的设备。但亚行则不然。由于 Windows 正在识别该设备,因此我没有真正需要测试其他 USB 物理插槽。我应该有。
因此,您可以尝试将电缆插入计算机上直接可用的所有 USB 物理插座。它确实对我有用。有时,计算机对 USB 插座的管理方式不同。
To complete the previous answers, another possible solution is to change the USB socket in which your cable is plugged in.
I had this problem (with the classical answer about using
adb kill-server / start-server
not working) and it solved it.Actually, it took some time to find that because Windows was correctly recognizing the device in my first socket. But not ADB. As Windows was recognizing the device, I had no real need to test other USB physical sockets. I should have.
So you can try to plug the cable in all your USB physical sockets directly available on your computer. It did worked for me. Sometimes the USB sockets are not managed the same way by a computer.
从 Android 4.2.2 开始,您必须在设备上确认它已连接到受信任的计算机。它将与 adb 版本 1.0.31 及更高版本一起使用。
Beginning from Android 4.2.2, you must confirm on your device that it is being attached to a trusted computer. It will work with adb version 1.0.31 and above.
这解决了我的问题
that solved my problem
我的一部手机也遇到过类似的问题。
我无法在任何计算机上连接和使用 USB 调试。
最后,我不得不手动重新启动手机上的USB调试[使用开发者菜单这样做是不够的]。
您只需在手机上运行一个命令 [我使用
Terminal Emulator
应用程序执行此操作]:adb usb
就是这样。
希望这对将来的人有帮助。
I've had a similar issue with one of my phones.
I was unable to connect and use usb debugging on any of my computers.
In the end, I had to restart the usb debugging on the phone manually [doing so using the Developer menu was not enough].
There's only one command you have to run on your phone [I did it using
Terminal Emulator
app]:adb usb
And that was it.
Hope this helps someone in the future.
您也可以尝试下载最新版本的
adb
http://developer.android.com/工具/help/adb.htmlYou may also try downloading newest version of
adb
http://developer.android.com/tools/help/adb.html重新启动设备。这总是可以在 Mac OS 上修复它,而
adb Kill-server
则不会。Reboot the device. This always fixes it on Mac OS, whereas
adb kill-server
does not.在装有 Android 4.2.2 的 Galaxy Nexus 上,我最初遇到了同样的问题,“adb devices”显示设备,但处于离线状态(USB 调试最初在我的设备上处于活动状态)。
以下是我为纠正这种情况而采取的步骤:
adb devices 现在列出了设备 id 并且没有离线。
On my Galaxy Nexus with Android 4.2.2, I had the same problem initially, 'adb devices' was showing the device but with offline status (USB debugging was initially active on my device).
These are the steps I took to remedy the situation :
adb devices now lists both device id and no offline.
我在这里发布我的问题,以防对其他人有帮助。
我的问题是我的同事连接到同一设备,而我无法连接到同一设备。
注意:我在通过 Wifi 连接 Amazon Fire TV 时遇到了此问题。
有 2 种解决方案:
容易“断开”他的连接(对不起,伙计:)
有点困难,但两个客户端可以使用同一设备(使用不同的 TCP 端口)
请看看这个答案
I post here my question just in case is helpful for somebody else.
My problem was that my colleague was connected to the same device and I was not able to connect to the same device.
Note: I had this problem with Amazon Fire TV connecting over Wifi.
There are 2 solutions:
Easy to "drop" his connection (sorry buddy :)
A bit more difficult but two clients can use the same device (use different TCP ports)
Please look at this answer
对于使用 Android 4.1.1 的我来说,只能重新启动设备
For me with Android 4.1.1 only rebooting device works
运行 SDK Manager 并安装 Android SDK 工具和 Android SDK 平台工具更新。 ADB 必须更新到 4.2.x 的新版本
Run SDk Manager and install Android SDK Tools and Android SDK Platform-tools updates. ADB must be updated to a new version for 4.2.x
我遇到了同样的问题,其他答案都不起作用。当您使用 wifi 模式连接到设备时(运行命令“adb tcpip 5555”),这种情况似乎经常发生。我找到了这个解决方案,它是一种解决方法,但确实有效。
这个过程有点漫长,但它是唯一对我每次都有效的过程。
I had the same issue and none of the other answers worked. It seems to occur frequently when you connect to the device using the wifi mode (running command 'adb tcpip 5555'). I found this solution, its sort of a workaround but it does work.
This process is a little lengthy but its the only one that has worked everytime for me.
如果客户的机器上有这个,结果发现他通过 网站 提供 adb 和 fastboot。由于感觉到臃肿,相关客户不想安装整个 SDK :S 。
因此,如果您看到
离线
,请确保您已下载并使用最新的 adb。我最终通过电子邮件给他发送了 adb 可执行文件。还值得检查您使用的 adb 是否在路径中正确。即在 Mac 上
Had this on client's machine it turned out he had an out of date version of adb installed via website offering adb and fastboot. The client in question didn't want to install the whole SDK because of perceived bloat :S .
So if you're seeing
offline
make sure you've downloaded and using the latest adb. I ended up emailing him adb executable.Also worth checking that the adb you are using is the correct one in the Path. i.e on Mac
如果上述步骤均无效。我的设备通过 wifi 连接后仍然离线。我执行了以下操作:
转到您的设备...
转到设置。
转到开发者选项。
仅允许在充电模式下进行 adb 调试。
像往常一样重复这些步骤。这是:
a.仅在充电模式下连接 USB。
b.打开命令写入:
- 亚行 TCPIP 4455
-亚行连接192.168.1.11:4455
b.断开 USB。
现在一切都对我有用。
if non of the steps work from the above. my device still offline after connected through wifi. i did the following:
go to your device...
go to settings.
go to developer options.
Allow adb debugging in charge mode only.
repeat the steps as you always do . which is:
a. connet your usb on chargemode only.
b. open command write:
- adb tcpip 4455
- adb connect 192.168.1.11:4455
b. disconnect usb.
now everythings work for me .
这总是使我的 Motorola MB525“在线”再次,在 adb 抱怨它会“离线”之后。顺便说一句,我正在使用 OSX。
This always brings my Motorola MB525 "online" again, after adb complains it would be "offline". I'm using OSX btw.
将 adb 升级到 SDK 版本后,将设备设置为授权模式后,我使 adb 在 GT-N8010(三星平板电脑)的 Android 4.4.2 上工作。
虽然它无法使用:
在 Ubuntu LTS 版本中发布:
此链接可能会有所帮助
无法将 Nexus 4 连接到 adb:未经授权
I made adb working on Android 4.4.2 with GT-N8010 (Samsung tablet) after setting device in authorized mode once upgraded adb to SDK version.
While It did not work using :
Shiped in Ubuntu LTS version :
This link may help then
Can't connect Nexus 4 to adb: unauthorized
在浪费了几个小时之后,我更新了我的
adb
版本,现在adb devices
显示我的设备在线,我可以再次在其上运行应用程序。After wasting hours on it, I have updated my version of
adb
and nowadb devices
shows my device online and I can run the app on it again.还要确保 adb 不会自动在您的进程中运行。如果在那里,右键单击打开文件位置,找出启动它的原因,然后用火杀死它。从更新的 android sdk 平台工具运行更新的 adb。这是我的问题,希望对某人有所帮助。
also make sure adb isn't running in your processes automatically. If it's there right click open file location, figure out what is starting it, kill it with fire. Run the updated adb from an updated android sdk platform tools. This was the issue with mine, hope it helps someone.
让我陷入困境的是,多个不相关的软件包恰好安装了 adb.exe——特别是对我来说(在 Windoze 上),手机 OEM 驱动程序安装包“很有帮助”地将 adb.exe 也安装到了 C:\windows 中,并且该目录出现在 %PATH% 中,早于我的 android SDK 的 platform-tools 目录。不出所料,手机 OEM 驱动程序包中包含的 adb.exe 比更新后的 android sdk 中的 adb.exe 要老得多。
所以 adb 对我来说工作得很好,直到有一天,有什么原因导致我更新手机的 Windows 驱动程序。一旦我这样做了,绝对不会让我的手机状态从“离线”改变——但问题与驱动程序无关。这只是驱动程序包安装了一个不同的 adb.exe - 并且是一个更旧的 adb.exe - 到一个具有更高优先级的目录中。
为了修复我的安装,我只需更改 PATH 环境变量以使 sdk 的 adb.exe 具有优先权。
快速检查后我发现“很多”不同的软件包都包含 adb.exe,因此请小心不要无意中将旧软件包插入到您的工具链中。
我一定是真的老了:我从来不记得这么愚蠢的问题花了这么长的时间才被发现。
What did me in is was that multiple unrelated software packages just happened to install adb.exe -- in particular for me (on Windoze), the phone OEM driver installation package "helpfully" also installed adb.exe into C:\windows, and this directory appears in %PATH% long before the platform-tools directory of my android SDK. Unsurprisingly, the adb.exe included in the phone OEM driver package is MUCH older than the one in the updated android sdk.
So adb worked just fine for me until one day something caused me to update the windows drivers for my phone. Once I did that, absolutely NOTHING would make my phone status change from "offline" -- but the problem had nothing to do with the driver. It was simply that the driver package had installed a different adb.exe - and a MUCH older one - into a directory with higher precedence.
To fix my installation I simply altered the PATH environment variable to make the sdk's adb.exe have priority.
A quick check suggested to me that "lots" of different packages include adb.exe, so be careful not to insert an older one into your toolchain unintentionally.
I must really be getting old: I don't ever remember such a stupid issue taking so endlessly long to uncover.
检查您运行的 ADB 版本是否比所连接设备上的操作系统版本新。对我来说,更新 ADB 有助于使设备上线。
Check that the ADB version that you are running is newer than the version of the OS on the connected devices. For me, updating the ADB helped to get the device online.