com.android.ddmlib.AdbCommandRejectedException:设备离线(即使设备已连接)

And*_*tel 29 android build android-studio

将Android Studio更新到2.1.2后,当我进行更改时,我收到了以下错误太多次.

com.android.ddmlib.AdbCommandRejectedException:设备脱机

安装APK时出错

问题是设备从未连接且未脱机

如果我拔下并重新插入设备,它会再次正常工作.这在以前版本的AS中从未发生过.

问题:是否有一个设置要在AS中更改才能停止发生或者是一个错误?

Neo*_*Neo 25

使Studio缓存无效,重新启动设备并且PC可以正常工作.有时端口的问题也一样,只需在更换电脑的usb端口后再尝试.


Mer*_*elm 8

重新启用USB调试可解决问题

设置 > 开发人员选项 >禁用和重新启用USB调试


Fah*_*had 7

You just need to restart ADB , no need to restart your PC or Phone

Try the below steps:

Go to the Android SDK platform-tools directory in the command prompt

Type adb kill-server
Then type adb start-server

Now try re-connecting ...

有效!

In my case I was debugging over wifi for a long time , then the ADB server needed to be refreshed to see the connected devices again

It Happened on Pixel device running Android 8.1.0 with Android Studio 3.0

Cheers!