终端输入
sudo lsof -i tcp:xxx
xxx为想要查看的端口
如果端口被占用,可以用这条命令杀掉进程
sudo kill PID
PID为sudo lsof -i tcp查到被占用的进程ID