使用adb获取设备信息: failed to start daemon error: cannot connect to daemon
目录
错误内容
failed to start daemon
error: cannot connect to daemon
错误原因
这个明显是adb的5037端口被占用了;
解决方案
方案一:关闭对应进程
第一种关闭占用5037端口的应用程序
1.查找占用5037的PID: netstat -ano|findstr "5037"
2.通过PID查找进程:tasklist/fi "PID eq 10552"
3.关闭进程:taskkill/PID 10552 /f
如果关闭失败:可以通过任务管理器-PID进行关闭
方案二:修改adb端口(推荐)
方案二重新设置adb的端口号
我的电脑-属性-高级系统设置-环境变量,
在系统设置中添加:ANDROID_ADB_SERVER_PORT,值为你设置的端口,
重启电脑既可以了
方案三:通过wifi链接
通过pc端wifi连接手机;
adb connect 192.168.2.103 //手机的ip