command to close and reopen port macos code example
Example 1: how to close a port mac
sudo lsof -i :5955
Example 2: release a port in mac
sudo lsof -i :<port>
Example 3: how to stop a port in macos
kill -9 port
sudo lsof -i :5955
sudo lsof -i :<port>
kill -9 port