我再也不能通过命令行或Eclipse使用ADB连接到我的设备了。

执行命令

adb devices

返回设备名称,但显示为脱机状态。

我尝试过的事情。

切换Android调试模式 重新安装谷歌USB驱动 将操作系统恢复到以前工作的备份(CyanogenMod) 换掉USB数据线 多次重启电话/电脑 更新Android SDK

我真的不知道发生了什么。你觉得我还能试什么,我洗耳恭听。

需要明确的是,如果你遇到了同样的问题,那么问题可能是SDK过时了。从4.2.2开始,有一个安全特性需要您确认连接设备的RSA指纹。打开SDK管理器并更新工具!然后重新启动。


当前回答

This is a lame case, but just in case... I have a mac laptop with a power/usb hub but it only has a couple usb ports so I hung another powered usb hub off that. Seems/seemed to work fairly well, but for some reason my android device wouldn't keep a connection. Plug it in, it shows 'device', but try to do anything via adb and get an error and status goes "offline". Drove me crazy. Then I decided to try plugging in Android device straight to the first hub... worked immediately and solidly. I had been using the two hub setup for a while, but all of a suddden it just stopped working. Hope it helps somebody!

其他回答

我在运行4.2.2 OTA更新的Nexus 7上遇到了同样的问题。我几乎可以肯定我在更新后通过USB和Wi-Fi连接了ADB,直到它停止工作。为了修复,我更新了我的SDK使用:

android update sdk --no-ui

现在我的开发工具是:

SDK版本16.0.2 SDK工具版本21.1 SDK API 17,版本2

如果你之前已经授权了你的电脑的RSA指纹,并尝试了adb kill-server等,但没有运气,你的问题可能只是在它被锁定时试图连接它。试着按下屏幕上的按钮并输入你的图案-这为我修复了它。

只需关闭服务器adb kill-server

对我来说,我有两个不同的SDK安装。当我启动Android SDK管理器并从Eclipse更新工具时,SDK路径指向一个位置,但命令行上使用的path环境变量指向另一个位置,该位置具有较旧版本的SDK,始终将4.2.2设备显示为脱机。

尝试重新启动adb服务器,操作如下:

adb kill-server

adb start-server

我也遇到过和你一样的问题。重新启动adb服务器将解决此问题。