how to exit a port in use mac code example Example 1: kill port in mac terminal sudo lsof -i :5955 Example 2: release a port in mac sudo lsof -i :<port>