ADB无法连接到守护程序

时间:2020-07-24 12:36:41

标签: android adb

我知道这看起来像一个骗子,但是我已经阅读了这里提到该ADB错误的每个线程。我找不到解决方案。 以前效果很好,对我来说这是一个非常突然的问题。

这是命令提示符下的输出:

C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb devices
   * daemon not running; starting now at tcp:5037
   adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
   * failed to start daemon
   adb.exe: failed to check server version: cannot connect to daemon
   
   C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb kill-server
   cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)
   
   C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb start-server
   * daemon not running; starting now at tcp:5037
   adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
   * failed to start daemon
   error: cannot connect to daemon
   
   C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb reconnect
   * daemon not running; starting now at tcp:5037
   adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
   * failed to start daemon
   error: cannot connect to daemon
   
   C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb reconnect device
   * daemon not running; starting now at tcp:5037
   adb: CreateFileW 'nul' failed: The system cannot find the file specified. (2)
   * failed to start daemon

系统: -Windows 10家庭版 -Android版本9(PAR-LX1M华为)

我已经尝试过的事情:

-检查端口是否正在被另一个进程使用

-重新启动两个设备

-撤销并返还USB调试授权

-重新安装平台工具

-仅删除3个ADB套件文件并重新安装

-完全删除带有所有文件的Android Studio,然后重新安装。

-卸载HiSuite

-禁用防火墙和防病毒软件

-从TaskManager结束adb.exe任务(该任务不是为了结束而首先运行)

-正在运行adb nodaemon服务器,这是输出

C:\Users\myuser\AppData\Local\Android\Sdk\platform-tools>adb nodaemon server
adb I 07-24 14:07:31 10484 47768 auth.cpp:437] adb_auth_init...
adb I 07-24 14:07:31 10484 11504 transport.cpp:282] [Phone Serial Number]: read thread spawning
adb I 07-24 14:07:31 10484 42584 transport.cpp:295] [Phone Serial Number]: write thread spawning
adb I 07-24 14:07:31 10484 47768 transport.cpp:1373] fetching keys for transport [Phone Serial Number]
adb I 07-24 14:07:31 10484 47768 auth.cpp:489] Calling send_auth_response
adb I 07-24 14:07:31 10484 47768 adb.cpp:114] [Phone Serial Number]: offline

然后它会不断运行。

此问题并未在Android Studio中开始,因为我当前未在该项目中使用它。该项目使用Unity,这给了我一个空白错误,指示未正确安装SDK。使用带有Unity的Android SDK工具进行检查或取消检查都不会产生相同的错误 Unity Error

这是Unity控制台中的错误

CommandWithNoStdoutInvokationFailure: Unable to start ADB server. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details.
UnityEditor.Android.Command.RunWithShellExecute (System.String command, System.String args, System.String workingdir, System.String errorMsg) 
UnityEditor.Android.ADB.StartServer () 
UnityEditor.Android.ADB.Run (System.String[] command, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidDeploymentTargetsExtension.GetKnownTargets (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.ProgressHandler progressHandler)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.GetTargetDevices (UnityEditor.Android.ADB adb)
UnityEditor.Android.PostProcessor.Tasks.CheckDevice.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()

任何帮助将不胜感激。 TIA!

更新:此问题在另一台Android设备上仍然存在。

更新2:尽管adb控制台显示“ offline”,但在前台运行adb nodaemon服务器,然后在Unity中构建似乎可以正常工作。问题仍然存在,为什么会发生这种情况?如何使它像以前一样正常工作?

0 个答案:

没有答案