android - 无法连接到 tcp :5037: cannot connect to 127. 0.0.1 :5037: No connection could be made because the target machine actively refused it. (10061)

标签 android shell sockets tcp adb

嗨,我是 android 的新手,我无法运行 adb.exe,它给我以下错误:

==>adb start-server
adb I  6108  5748 adb.cpp:219] Android Debug Bridge version 1.0.32
adb I  6108  5748 adb.cpp:219] Revision 09a0d98bebce-android
adb I  6108  5748 adb.cpp:219]
adb I  6108  5748 adb_client.cpp:126] _adb_connect: host:version
adb I  6108  5748 sysdeps_win32.cpp:742] could not connect to tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)
adb I  6108  5748 adb_client.cpp:175] adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
Cannot open 'nul': The system cannot find the file specified. (2)
* failed to start daemon *
error: cannot connect to daemon

这个错误究竟意味着什么......?

Cannot open 'nul': The system cannot find the file specified. (2)  

这是什么错误……?

最佳答案

确保您已安装设备驱动程序和 adb 服务 并在 android device -> setting -> developer options 中激活 USB 调试 并且当您通过 USB 端口连接时必须能够看到您的设备(通过此命令:adb devices)

因此,当您通过 USB 连接时,请遵循以下命令:

1-stay 通过 USB 连接
2-连接到您的WIFI网络(电脑和移动设备都可以)
3-ping DeviceIP(必须能ping到你的设备)
4- adb kill-server
5-adb usb
6-adb tcpip 5556
7-adb connect "yourDeviceIP:5556"
8-adb devices (一定要看到两个设备名,其中一个是deviceIP:5556)
9-拔下USB线

然后就完成了!你可以测试你的应用程序

关于android - 无法连接到 tcp :5037: cannot connect to 127. 0.0.1 :5037: No connection could be made because the target machine actively refused it. (10061),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34327974/

相关文章:

android - 矢量图像在 Android 中显示错误

java - 如何设置和获取唯一的名称/标签来动态添加子android

java - 可区分的套接字输入

java - 将 DataSnapshot 转换为类对象

python - 如何在mongodb shell中设置mongoengine的ReferenceField值?

linux - 如何根据日期和时间删除目录

python - 在python中,将系统命令的输出作为字符串获取

c - 调试段错误——程序总是按它应该的方式运行,但总是出现段错误

c - 如果没有 "\n",服务器端 printf() 不会打印(使用套接字的 TCP 客户端-服务器)

android - Android Studio 中的 Graphhopper 0.3 未编译 : Dex Exception