如何使用ADB Shell查找进程正在使用的端口? [英] How to use ADB shell to find the ports which a process is using?
本文介绍了如何使用ADB Shell查找进程正在使用的端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如,在Android中,进程1234的PID使用端口2222、2223、2224.现在我有一个PID1234.我想知道如何找出进程正在使用的端口号2222、2223、2224?
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?
我曾尝试像在Linux中那样使用netstat -anp,但这没有用. ADB Shell中的netstat -anp与netstat具有相同的效果,后者没有任何命令参数.
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.
推荐答案
您可以使用busybox netstat -pt
或cat /proc/1234/net/tcp
这篇关于如何使用ADB Shell查找进程正在使用的端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文