Unable to run 'adb': null
12:23 'C:\Users\HW\AppData\Local\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
12:23 * daemon not running; starting now at tcp:5037
12:23 could not read ok from ADB Server
12:23 * failed to start daemon
12:23 error: cannot connect to daemon
今天出现上面的问题,以为端口被占用,下面是解决端口占用的问题的
-
首先,打开命令行工具,查看失败信息中提示的端口是否被占用(比如我这边提示的是5037)
netstat -ano | findstr :5037
-
如果端口被占用,在任务列表中找到占用端口的进程(可在上一步中查看)
tasklist | findstr processID
-
关闭占用这个端口的程序,然后运行命令手动启动adb,成功
扫描二维码关注公众号,回复: 2417463 查看本文章adb start-server
但是我发现并没有程序占用这个端口。。。后来看到一个帖子
21:20 Unable to run 'adb': null 21:20 'E:\AndroidSDK\platform-tools\adb.exe start-server' failed -- run manually if necessary 21:20 error: cannot open transport registration socketpair: Invalid argument 21:20 This application has requested the Runtime to terminate it in an unusual way. 21:20 Please contact the application's support team for more information. 21:20 could not read ok from ADB Server 21:20 * failed to start daemon * 21:20 error: cannot connect to daemon
adb无法连接,出现如上日志文件
解决方法:
windows 10环境下关闭防火墙即可
试了一下果然就行了