Android 设备不断与 adb / eclipse 断开连接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18198217/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android device keeps disconnecting from adb / eclipse
提问by clu
So I've read nearly every stack overflow answer about this issue, but still no solution. My device keeps getting disconnected. I've switched through 12 wires, I've tried every USB port; nothing. Eclipse keeps dropping the connection. It happens most often when I enter debug mode. Has anyone found a solution to this? Is this a bug in the new update? Seriously, this makes debugging and testing so painful. It slows down my testing by at least 3 times. There has to be a better solution.
所以我已经阅读了几乎所有关于这个问题的堆栈溢出答案,但仍然没有解决方案。我的设备不断断开连接。我已经切换了 12 条线,我尝试了每个 USB 端口;没有。Eclipse 不断断开连接。当我进入调试模式时,它最常发生。有没有人找到解决方案?这是新更新中的错误吗?说真的,这让调试和测试变得如此痛苦。它使我的测试速度至少减慢了 3 倍。必须有更好的解决方案。
回答by William Pownall
First thing I tend to try is the following commands in cmd/terminal
我倾向于尝试的第一件事是 cmd/terminal 中的以下命令
adb kill-server
adb start-server
And lastly,
最后,
adb devices
To check the device is connected.
检查设备是否已连接。
Following that I'd try restarting the device, and perhaps as a last resort uninstall/reinstall it's drivers.
之后我会尝试重新启动设备,也许作为最后的手段卸载/重新安装它的驱动程序。
Edit: also, do you have access to another device? In the past I've had issues with specific devices constantly dropping out.
编辑:另外,您可以访问其他设备吗?过去,我遇到过特定设备不断退出的问题。
回答by Peter J Lord
I experience that when my nexus7 2012 kept disconnecting; root cause was the USB3 connection. Changing to a USB2 port fixed my issues; can you try switching to a lower speed port?
我体验过当我的 nexus7 2012 不断断开连接时;根本原因是 USB3 连接。更改为 USB2 端口解决了我的问题;你可以尝试切换到低速端口吗?
回答by Newtz
I was having a very similar problem but using Android Studio on OS X. By default Android Studio points to an SDK inside it's application bundle so I changed the SDK location setting to point to another version of the Android SDK I had downloaded manually and this seems to have fixed the disconnection issues I was having.
我有一个非常相似的问题,但在 OS X 上使用 Android Studio。默认情况下,Android Studio 指向它的应用程序包内的一个 SDK,所以我将 SDK 位置设置更改为指向我手动下载的另一个版本的 Android SDK,这似乎解决了我遇到的断开连接问题。
Instructions for changing the SDK location setting can be found in this answer.
可以在此答案中找到更改 SDK 位置设置的说明。
回答by JanB
My connected device (an Acer) was working a treat until I rebooted my mac. After the reboot, Eclipse dropped the connection every single time I ran the app. I tried two cables and every port in my iMac but nothing worked. I had to disconnect and reconnect the device for every run (a real pain when debugging!).
在我重新启动 Mac 之前,我连接的设备(Acer)一直在工作。重新启动后,Eclipse 每次运行该应用程序时都会断开连接。我在 iMac 中尝试了两条电缆和每个端口,但没有任何效果。每次运行我都必须断开并重新连接设备(调试时真的很痛苦!)。
What worked for me was to run the app. When the window appeared to choose the device to run on (which was empty), I disconnected then reconnected the device, but before clicking to run, I checked the box (bottom left) to use this device for each run. It now runs every time directly on the device.
对我有用的是运行该应用程序。当窗口出现选择要运行的设备(这是空的)时,我断开连接然后重新连接设备,但在单击运行之前,我选中了框(左下角)以在每次运行时使用此设备。它现在每次都直接在设备上运行。
回答by amanieux
a unpowered usb hub did fix the problem for me. it was happening on both my samsung s6 and my sony z5 premium.and both on my pc and my mac. (using android studio).
一个无电源的 USB 集线器确实为我解决了这个问题。它发生在我的 samsung s6 和我的 sony z5 premium. 以及我的个人电脑和我的 mac 上。(使用安卓工作室)。
回答by PDM
Use short usb cable. The shorter the length of cable, the more stable the adb connection. I had the same problem for long time. I changed the cable to shorter one and I haven't got that problem anymore.
使用短的 USB 电缆。电缆长度越短,adb 连接越稳定。我有同样的问题很长一段时间。我把电缆改成了更短的电缆,我再也没有这个问题了。