我正在使用此命令从计算机运行adb端口转发到mobile:
adb forward tcp:6401 tcp:50000
在我通过同一台计算机访问它时,它完全正常(访问127.0.0.1),但是一旦我尝试通过当地WiFi(本地IP 192.168.1.134)即可达到它,我会得到"连接拒绝" 。我做错了什么?
我正在使用此命令从计算机运行adb端口转发到mobile:
adb forward tcp:6401 tcp:50000
在我通过同一台计算机访问它时,它完全正常(访问127.0.0.1),但是一旦我尝试通过当地WiFi(本地IP 192.168.1.134)即可达到它,我会得到"连接拒绝" 。我做错了什么?
I am running adb port forwarding from computer to mobile with this command:
adb forward tcp:6401 tcp:50000
which is working completely fine (accessing 127.0.0.1) when I am accessing it through the same computer, but once I try to reach it through local WiFi (local IP 192.168.1.134) I am getting 'connection refused'. What am I doing wrong ?
首先将adb与USB连接到在同一网络中进行连接。不要将adb与USB断开连接。现在通过TCP执行adb。如果您转发到某个端口,则必须在该端口禁用防火墙。如果您使用Linux,请禁用端口上的防火墙。打开终端或按 ctrl+alt+t
,然后尝试使用这些命令
ufw allow port_number
此处将此端口号替换为转发的新端口号。
如果您是Windows用户 这个线程可能有助于您。 允许此端口重新启动ADB服务器。通过WiFi连接设备,您可以从PC中删除USB。如果您需要知道adb中的端口转发,请参阅这个线程。
First connect adb with usb then make connection in same network. Don't disconnect adb over usb. Now execute adb over tcp. If you are forwarding to some port means you have to disable firewall on that port. To disable firewall on port if you use linux. Open terminal or press ctrl+alt+t
, Then try with these commands
ufw allow port_number
here replace this port number with forwarded new port number.
If you are windows user this thread may helpful for you. After allowing this port restart your adb server. Once the device is connected over wifi then you can remove your usb from your pc. If you need to know about port forwarding in adb see this thread.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有