Kill app with opened port

Put somewhere in Your ~/.zshrc or other init shell script:

kill_port() {
    if [ -n "$1" ]; then
        lsof -ti :"$1" | xargs kill
    else
        echo "Pass in port number."
    fi
}