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

执行命令

adb devices

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

我尝试过的事情。

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

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

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


当前回答

对我来说很管用:一开始很管用,但过了一段时间就下线了。 我做了以下事情: 亚行kill-server 亚洲开发银行启动服务器。 再次用usb连接电脑 亚洲开发银行设备, 提供的空列表的输出。 Adb tcpip 5555, Adb connect <移动wifi IP地址> 然后它又上线了。

其他回答

我通过同样的问题,这解决了我。首先通过usb连接您的手机,然后确保您检查您的移动IP在设置>>关于手机>>状态下运行以下命令。


adb kill-server
adb start-server
adb tcpip 5555 //it resets port so put port you want to connect
adb connect 192.168.1.30:5555 //ip:port of your mobile to connect
adb devices //you will be connected over wifi

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!

Try

adb usb 

我将我的连接方法更改为tcpip,然后我认为如果我杀死服务器并启动它,它将重置连接方法,但它不会

这就是为什么之前的答案都不适用于我的情况

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

这些答案对我都没用。设备一直处于离线状态。真正解决这个问题的是耐心!

也就是说,在adb connect命令执行后,只需等待一分钟即可自动修复100%的问题。