我使用以下命令将机器端口转发给模拟器
adb转发tcp:1234 TCP:8080
我想查看目前所有端口的转发方式以避免任何冲突。怎么做?
我使用以下命令将机器端口转发给模拟器
adb转发tcp:1234 TCP:8080
我想查看目前所有端口的转发方式以避免任何冲突。怎么做?
I have forwarded machine port to emulator using following command
adb forward tcp:1234 tcp:8080
I wanted to see currently what all ports are forwarded to avoid any conflicts. How to do that ?
我认为自早期答案以来已添加新命令:
adb forward --list
I think a new command has been added since the earlier answers:
adb forward --list
你的意思是你想看看PC或Android设备上使用哪些端口?您可以使用 netstat
命令。
在windows上: netstat -an | find /i "listening"
在Linux上: `netstat -an | grep"听" (注意倾听后的空间)
这显示了侦听传入连接的所有端口(即,在它们后面有某种服务器)。如果您需要知道哪个服务器,您可以在Linux上使用它: netstat -anp | grep "LISTEN "
。不知道Windows对方,但是有一个 -o
切换要打印进程ID,您可以将其与任务管理器中的那些进行比较。
Do you mean you want to see which ports are being used on the PC or Android device? You can use the netstat
command for this.
On Windows: netstat -an | find /i "listening"
On Linux: `netstat -an | grep "LISTEN " (notice the space after LISTEN)
This shows all the ports that are listening for incoming connection (i.e. have a server of some kind behind them). If you need to know which server, you can use this on Linux: netstat -anp | grep "LISTEN "
. Don't know about the Windows counterpart, but there's a -o
switch to print the process ID and you can compare it to the ones in task manager.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有