Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 771
user1960407 Avatar asked Jan 09 '13 06:01

user1960407


1 Answers

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

like image 114
Alex P. Avatar answered Sep 20 '22 06:09

Alex P.