为什么 adb 在设备字符串之后返回离线?

发布于 2024-12-17 01:44:48 字数 300 浏览 1 评论 0原文

我使用“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 技术交流群。

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

发布评论

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

评论(20

夏末 2024-12-24 01:44:48

请尝试以下操作:

  1. 拔下 USB 插头,然后重新插回。

  2. 转到设置 ->应用->开发您的设备
    并取消选中USB调试模式,然后再次选中它。

  3. 重新启动 PC 上的 adb。
    adb 终止服务器
    进而
    adb start-server

  4. 重新启动您的设备并重试。

Try the following:

  1. Unplug the usb and plug it back again.

  2. Go to the Settings -> Applications -> Development of your device
    and uncheck the USB debugging mode and then check it back again.

  3. Restart the adb on your PC.
    adb kill-server
    and then
    adb start-server

  4. Restart your device and try again.

梦太阳 2024-12-24 01:44:48

要完成前面的答案,另一个可能的解决方案是更改插入电缆的 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.

橘香 2024-12-24 01:44:48

从 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.

∞梦里开花 2024-12-24 01:44:48
 adb kill-server
 adb start-server

这解决了我的问题

 adb kill-server
 adb start-server

that solved my problem

云朵有点甜 2024-12-24 01:44:48

我的一部手机也遇到过类似的问题。
我无法在任何计算机上连接和使用 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.

↙温凉少女 2024-12-24 01:44:48

您也可以尝试下载最新版本的 adb http://developer.android.com/工具/help/adb.html

You may also try downloading newest version of adb http://developer.android.com/tools/help/adb.html

爱她像谁 2024-12-24 01:44:48

重新启动设备。这总是可以在 Mac OS 上修复它,而 adb Kill-server 则不会。

Reboot the device. This always fixes it on Mac OS, whereas adb kill-server does not.

栀梦 2024-12-24 01:44:48

在装有 Android 4.2.2 的 Galaxy Nexus 上,我最初遇到了同样的问题,“adb devices”显示设备,但处于离线状态(USB 调试最初在我的设备上处于活动状态)。

以下是我为纠正这种情况而采取的步骤:

  1. 禁用 USB 调试(设备未连接到 PC)
  2. 重新启用 USB 调试
  3. 现在连接到您的 PC,现在设备上(而不是 PC)上会弹出一个窗口,要求您验证 PC ,就是这样...

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 :

  1. Disable USB debugging (Device not connected to PC)
  2. Re enable USB debugging
  3. Now connect to your PC, now a pop up on the device (not on PC) will ask you for authenticating the PC, Thats it...

adb devices now lists both device id and no offline.

若能看破又如何 2024-12-24 01:44:48

我在这里发布我的问题,以防对其他人有帮助。
我的问题是我的同事连接到同一设备,而我无法连接到同一设备。

注意:我在通过 Wifi 连接 Amazon Fire TV 时遇到了此问题。

有 2 种解决方案:

容易“断开”他的连接(对不起,伙计:)

Restart the device
adb kill-server
adb start-server
adb connect device-ip

有点困难,但两个客户端可以使用同一设备(使用不同的 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 :)

Restart the device
adb kill-server
adb start-server
adb connect device-ip

A bit more difficult but two clients can use the same device (use different TCP ports)

Please look at this answer

夏夜暖风 2024-12-24 01:44:48

对于使用 Android 4.1.1 的我来说,只能重新启动设备

For me with Android 4.1.1 only rebooting device works

得不到的就毁灭 2024-12-24 01:44:48

运行 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

海之角 2024-12-24 01:44:48

我遇到了同样的问题,其他答案都不起作用。当您使用 wifi 模式连接到设备时(运行命令“adb tcpip 5555”),这种情况似乎经常发生。我找到了这个解决方案,它是一种解决方法,但确实有效。

  1. 断开 USB 连接(或关闭设备 wifi,如果您通过 wifi 连接)
  2. 关闭 eclipse/其他 IDE
  3. 检查正在运行的程序中是否有 adb.exe(Windows 中的任务管理器)。如果它正在运行,则终止它。
  4. 重新启动您的 Android 设备
  5. 设备重新启动后,通过 USB 连接并运行“adb devices”。这应该启动 adb 守护进程。您应该会看到您的设备再次在线。

这个过程有点漫长,但它是唯一对我每次都有效的过程。

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.

  1. Disconnect the usb (or turn off devices wifi if your connected over wifi)
  2. Close eclipse/other IDE
  3. Check your running programs for adb.exe (Task manager in Windows). If its running, Terminate it.
  4. Restart your android device
  5. After your device restarts, connect it via USB and run 'adb devices'. This should start the adb daemon. And you should see your device online again.

This process is a little lengthy but its the only one that has worked everytime for me.

沙与沫 2024-12-24 01:44:48

如果客户的机器上有这个,结果发现他通过 网站 提供 adb 和 fastboot。由于感觉到臃肿,相关客户不想安装整个 SDK :S 。

因此,如果您看到离线,请确保您已下载并使用最新的 adb。我最终通过电子邮件给他发送了 adb 可执行文件。

还值得检查您使用的 adb 是否在路径中正确。即在 Mac 上

$ which adb
/Users/me/dev/adt-bundle-mac-x86_64/sdk-macosx/platform-tools/adb 

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

$ which adb
/Users/me/dev/adt-bundle-mac-x86_64/sdk-macosx/platform-tools/adb 
夜声 2024-12-24 01:44:48

如果上述步骤均无效。我的设备通过 wifi 连接后仍然离线。我执行了以下操作:

转到您的设备...

  1. 转到设置。

  2. 转到开发者选项。

  3. 仅允许在充电模式下进行 adb 调试。

  4. 像往常一样重复这些步骤。这是:

    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...

  1. go to settings.

  2. go to developer options.

  3. Allow adb debugging in charge mode only.

  4. 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 .

三寸金莲 2024-12-24 01:44:48
  1. 确保设备设置为 USB 调试
  2. 让 adb 客户端运行(例如通过“adb usb”或 adb start-server”
  3. 让设备通过 USB 连接!!!
  4. 然后重新启动设备。

这总是使我的 Motorola MB525“在线”再次,在 adb 抱怨它会“离线”之后。顺便说一句,我正在使用 OSX。

  1. make sure the device is set for usb debugging
  2. Have the adb client running (e.g. via "adb usb" or adb start-server"
  3. LEAVE the device connected via usb!!!
  4. AND THEN reboot the device.

This always brings my Motorola MB525 "online" again, after adb complains it would be "offline". I'm using OSX btw.

屌丝范 2024-12-24 01:44:48

将 adb 升级到 SDK 版本后,将设备设置为授权模式后,我使 adb 在 GT-N8010(三星平板电脑)的 Android 4.4.2 上工作。

~/local/opt/Android/Sdk/platform-tools/adb
Android Debug Bridge version 1.0.32

虽然它无法使用:

adb version   
Android Debug Bridge version 1.0.31

在 Ubuntu LTS 版本中发布:

apt-cache show android-tools-adb  | grep Version
Version: 4.2.2+git20130218-3ubuntu23

此链接可能会有所帮助

无法将 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.

~/local/opt/Android/Sdk/platform-tools/adb
Android Debug Bridge version 1.0.32

While It did not work using :

adb version   
Android Debug Bridge version 1.0.31

Shiped in Ubuntu LTS version :

apt-cache show android-tools-adb  | grep Version
Version: 4.2.2+git20130218-3ubuntu23

This link may help then

Can't connect Nexus 4 to adb: unauthorized

知足的幸福 2024-12-24 01:44:48

在浪费了几个小时之后,我更新了我的 adb 版本,现在 adb devices 显示我的设备在线,我可以再次在其上运行应用程序。

After wasting hours on it, I have updated my version of adb and now adb devices shows my device online and I can run the app on it again.

鸠书 2024-12-24 01:44:48

还要确保 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.

梦晓ヶ微光ヅ倾城 2024-12-24 01:44:48

让我陷入困境的是,多个不相关的软件包恰好安装了 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.

新雨望断虹 2024-12-24 01:44:48

检查您运行的 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.

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