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

执行命令

adb devices

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

我尝试过的事情。

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

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

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


当前回答

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

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

其他回答

我通过同样的问题,这解决了我。首先通过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!

如果你在通过tcpip无线连接你的设备时得到这个,然后尝试断开你的设备:

Adb disconnect <your_ip_address>:port_number或Adb disconnect

eg

Adb disconnect 192.168.1.2:5555 或 亚行断开

不同之处在于,第一个将只断开所需的设备,第二个将断开所有设备。

使用此命令的好处是您不必关闭并重新启动服务器。关闭和重新启动服务器需要你的设备连接到你的电脑,这是最恼人的过程。

这些答案对我都没用,我也试过无线。我注意到adb.exe一直在我的系统进程中运行。右键点击它们,发现adb从安装的应用程序(在我的例子中是Droid Explorer)自动运行。一旦我卸载了自动启动ADB的应用程序,我就可以终止进程,并看到ADB不再自己运行。从平台工具中运行更新后的adb,一切就绪!希望这能帮助到一些人。

Adb重新连接脱机-从设备端启动连接以强制重新连接