在Android中为没有busybox的端口查找pid

时间:2018-07-11 15:15:31

标签: android linux android-studio netstat

我们正在使用一个特殊的Android,无法安装应用。当我运行netstat时,我可以看到端口1975处于侦听状态。我想知道哪个进程正在使用此端口,但不使用busybox。有办法吗?

另一个问题是,为什么在使用adb shell时无法应用netstat或lsof开关?看来,adb shell会忽略开关并输出相同的结果。 netstat的输出总是像this

1 个答案:

答案 0 :(得分:0)

lsof可能有用,请尝试

lsof -i :port

或netstat

netstat -atnp | grep port

注意:p-显示链接端口的pid

OR ss工具

ss -tanp | grep port