【问题标题】:Warning Adb connection Error:An existing connection was forcibly closed by the remote host警告 Adb 连接错误:远程主机强制关闭现有连接
【发布时间】:2020-09-04 17:34:21
【问题描述】:

当我连接我的 redmi note 5 pro 并尝试运行 android 时,我在 android studio 上收到此警告。

Adb 连接错误:一个现有的连接被远程主机强行关闭。

我试过了

adb kill-server && adb start-server
   remove any adb process in the taskbar
   restart studio, clean and rebuild

【问题讨论】:

  • 答案是否解决了您的问题?
  • 好的,谢谢@Daniel,

标签: android android-studio adb


【解决方案1】:

更改 Android SDK 工具文件夹为我解决了这个问题。

检查您是否安装了 2 个 Android SDK 工具。可能缺少更新。

我没有使用我自定义的 Android SDK 工具文件夹,而是使用了 Bumblebee 安装提供的文件夹。

在您的项目根目录上 > local.properties 文件设置:

sdk.dir=C:\\Users\\YOUR_USER_NAME\\AppData\\Local\\Android\\Sdk

还要检查 PATH 变量以删除重复项或旧 SDK。

【讨论】:

    【解决方案2】:

    以下步骤应该适合您

    Disable USB debugging
    
    Disable Developer mode
    
    Unplug the device from the USB cable
    
    Re-enable Developer mode
    
    Re-enable USB debugging
    
    Reconnect the USB cable to your device
    

    请务必按此顺序进行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-02
      • 1970-01-01
      • 2012-05-21
      • 2013-10-05
      • 2020-10-05
      • 2011-11-04
      • 2019-01-14
      相关资源
      最近更新 更多