如何让 D-Link 路由器通过 TCP 连接 Android 与 ADB?

How to Let D-Link Router Connect Android with ADB over TCP?

我正在尝试通过 TCP 使用 ADB 调试 Flutter 应用程序,因此根据 this 尝试了以下(Android 通过 USB 连接):

adb tcpip 5555
adb connect <Android-ip-address>:5555

但我总是得到 unable to connect to <Android-ip-address>:5555: No route to host。 我将插件 Android WiFi ADB 安装到 Android Studio,但是...没希望了。

之后,我尝试使用该命令 ping <Android-ip-address> 从 PC ping 我的 Android phone,但再次失败,输出为 From <PC-ip-address> icmp_seq=1 Destination Host Unreachable.

现在我尝试做同样的事情 (PC & phone),但是在另一个路由器 (Tenda) 上,它运行得很好。

所以问题出在我的路由器上,它是固件版本为 ME_1.03 的 D-Link。我搜索了 "Port Forwarding" 之类的东西,但我不知道自己在做什么,也没有找到任何结果。

我该怎么做才能解决。

这与路由器类型无关(以防它使用与 TCP/IP 不同的东西,大声笑)。您需要仔细检查两个设备是否都在一个本地网络中。

如果不在路由器上进行任何额外设置,您的IP地址可能是这样的xxx.xxx.xxx.***xxx 的部分应该与两个设备相同。完成后,按照说明 from the source。请注意,在使用 TCP 之前,您需要使用 USB 连接设备。

固件可以在第 33 页和第 45 页找到 here below DSL > 2750U, while there are 2-3 different hardware revisions, therefore it is rather unclear which device it actually is - for some revisions there is newer firmware. Generally, the router's network bridge in between wired LAN and WiFi needs to be enabled, in order to connect. Just see the router's manual。如果没有那个桥接器,您只能从笔记本电脑连接 adb,通过与智能手机相同的无线网段到(除非在路由器上启用 "User Isolation")。

终于找到了。这是因为路由器中有一个名为 WIFI/User 隔离的功能(正如其他人所说)。但就我而言,这称为中继阻塞。无论如何,你必须禁用它。

D-Link (DSL-2740U) - Firmware Version ME_1.03中:

主页 ---> 高级 ---> 高级无线设置 ---> 中继阻止。 检查禁用的选择。