If something crashes every time you start it then consider how you are starting it. The "best" way is from the Launchpad. I have had trouble when using "Keep in Dock" because this was starting a child process that was only started correctly via the Launchpad. Another option here is to drag the app from the Applications folder in Finder straight to the Dock but you will then see two icons when the app is running.
If you have a "butterfly" keyboard and are having problems then try following the steps at How to clean the keyboard of your MacBook or MacBook Pro - Apple Support.
If you need to know which process is using a specific TCP/IP port then lsof is the best option, specifically:
sudo lsof -nP -iTCP -sTCP:LISTEN
I have seen issues where some code returns an IP address that is not the one from the current network. This happened after changing networks a few times. Executing ifconfig
and looking closely I could see two IPv4 addresses for the same network interface, en0. So assuming 192.168.21.12 is the wrong/extra address you can remove it as follows:
sudo ifconfig en0 delete 192.168.21.12
If you are struggling to connect to a network, a good first step is to "forget" the network and also remove it from "Keychain Access" if it is in there, under "Passwords".
After you have tried all the usual, forget network, reboot stuff then you might want to try the following command while trying:
tail -f /var/log/wifi.log
If that still does not work or give you a clue then airport – the Little Known Command Line Wireless Utility might help but it is an "advanced" utility, not for the faint hearted!
In the menu bar at the top of your screen is the network or Wi-Fi icon, hold the Option key down and click the icon. Now the drop down menu shows lots of detail about your current connection and some extra options. Near the top of the list is "Open Wireless Diagnostics...", click this, when the window opens the Menu Bar will show "Wireless Diagnostics" next to the Apple icon, from the Menu Bar, you can select other options like Scan and Info.