How to use ADB shell to find the ports which a process is using?

前端 未结 2 593
余生分开走
余生分开走 2021-02-06 03:13

For example, in Android, the PID of a process 1234 is using ports 2222,2223,2224. Now I have a PID 1234. I was wondering how to find out port numbers 2222, 2223, 2224 which the

相关标签:
2条回答
  • 2021-02-06 03:54

    Try to check my github repository, https://github.com/LipiLee/netstat.

    I updated toolbox's netstat in Android source code(https://android.googlesource.com/platform/system/core/+/master/toolbox/netstat.c).

    UPDATE: The toolbox's netstat was replaced with toybox's netstat in Android M version. So the netstat in toolbox was removed in the Android source tree.

    0 讨论(0)
  • 2021-02-06 03:55

    You can either use busybox netstat -pt or cat /proc/1234/net/tcp

    0 讨论(0)
提交回复
热议问题