문제

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 process is using?

I have tried using netstat -anp just as the way in Linux, but that didn't work. netstat -anp in ADB shell has the same effect as just netstat, which is without any command arguments.

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top