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

执行命令

adb devices

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

我尝试过的事情。

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

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

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


当前回答

重新启动设备。我尝试了这里列出的所有方法来让我的HTC手机(运行Android 4.0.3)工作,但adb设备一直显示它离线。重启后,手机终于上线了。这里的一些其他建议可能有助于手机被识别出来,但在试用过程中重新启动几次肯定不会有什么坏处。

其他回答

由于没有人对我的情况给出答案:您可能无法访问~/。android / adbkey文件。如果最初使用sudo启动adb,它将生成一个公钥对,将其写入~/.android/adbkey。Pub和~/android/adbkey。当然,私钥是chmod 600—仅对主目录中的根目录可读。随后以普通用户启动adb将不允许访问私钥文件,这反过来会以“设备脱机”的方式无声地失败。

分享一下我的情况:

在我的局域网中,所有的andorid板都有相同的默认MAC地址。 所以它将通过DHCP获得相同的IP,因为它有相同的MAC地址。

在局域网中,有多个具有相同IP的android板。 adb可以连接到板子(其中一个),可以打开板子(其中一个)的shell,但在将文件推到板子或其他操作时,会出现“设备离线”。

解决方案: 重写MAC地址,得到不同的IP。

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!

尝试关闭usb调试一次,然后再次启用它,然后将您的设备连接到system: link

我在Mac上解决的问题是将adb更新到最新版本(1.0.32)。现在我又可以看到我的设备在线了