Apple Mac

In 2017 I started using a MacBook Pro, having not used a Mac since 1995 when I was last doing development work on the platform. Needless to say it took some adjusting and getting used to, so this is what I learnt and some helpful, hopefully, notes.

I started with a MacBook Pro (Retina, 15-inch, Mid 2015), which I have to say was a very nice and well made machine. Then in December 2017 I switch to a MacBook Pro (15-inch, 2016) which is all USB-C and has the Touch Bar.

If you want to try a Mac out but don't want to commit then have a look at MacinCloud - Rent a Mac in the Cloud! - Mac in Cloud, you won't get the full experience but it will give you a good idea of what a Mac is like and you can use this for cross platform development with a Mac if necessary.

Hints & Tips

Finder Sorting: if you want Finder to always sort with folders first then open a Finder window, open Preferences and select Advanced, the option is there
Show Hidden Files: in an Open/Save Dialog or in Finder press Cmd+Shift+Period to display hidden files and directories
Print Screen: press Cmd+Shift+3 to get your screen saved as a PNG on the Desktop
Print Part Screen: press Cmd+Shift+4, you then get a cross-hair to select the part you want, or press space when the cross-hair shows to get a camera so you can select a Window. See How to take a screenshot on your Mac - Apple Support for more details and options
Screenshot Utility if you press Cmd+Shift+5 you will get a powerful and flexible screenshot utility, this was introduced in macOS Mojave (10.14)
Delete: a Mac has the Backspace key but not Delete like Windows, press Fn+Backspace to get a Delete
Page Up: this is fn+up
Page Down: this is fn+down
Do Not Disturb: in System Preferences -> Notifications you can turn on Do Not Disturb "When mirroring to TV's and projectors", a handy option but possibly on by default
Flush the DNS Cache: on OS X 10.9 or higher you need to execute the following two commands:
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder

Hostname - you can set this via System Preferences -> Sharing, see macOS Sierra: Change your computer’s local hostname
Space Separators in Dock - no idea why Apple hid this but try this How to Group Mac App Icons More Prominently in Your Dock - Mac Rumors
Typing Emojis - press Ctrl+Cmd+Space and a dialog will appear, then just click whatever you want to insert
Accented Characters - very similar to getting an emoji, hit Ctrl+Cmd+Space but this time click the grey icon in the top right, this will expand the emoji dialog to give more options, including adding things to your favourites but vitally "Latin" when you can find characters with accents on. Another option is to hold the letter down on the keyboard, so press the letter e and hold it, then press the number of the accent you want

Handy Articles

Some useful articles to help you learn about your Mac:
How to use the Touch Bar on your MacBook Pro - Apple Support
How to use the Force Touch trackpad - Apple Support
Mac keyboard shortcuts - Apple Support
Mac tips for Windows switchers - Apple Support

Troubleshooting

Starting App

If something crashes every time you start it then consider how you are starting it. The "best" way is from the Lanuchpad. 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.

Security

See Apple security updates - Apple Support for details about security updates

Battery

If you go to "Apple Menu" -> "About This Mac" -> "System Report" -> "Hardware" -> "Power" -> "Health Information" you will see a "Cycle Count" and "Condition", all being well the condition will be "Normal".

File System

In September 2017 Apple release macOS High Sierra, which was the first shipping of APFS, read more details on this at A ZFS developer’s analysis of the good and bad in Apple’s new APFS file system | Ars Technica.

Useful Tools

iTerm2 - macOS Terminal Replacement - a lot of people use this, although I have never done so

Setting Up...

Being a Software Developer means you probably want various tools and utilities on you Mac to make like easier therefore I would suggest installing Homebrew from https://brew.sh/ which gives you the brew command and then Homebrew-Cask which makes a number of application type installs easier, including PowerShell. Installing Homebrew requires one command from their site and Homebrew-Cask is another one line install from their site, which uses Homebrew, so very simple.

The general principle with brew and brew cask seems to be that brew on its own is for command line stuff and brew cask for GUI stuff but also that brew cask is more flexible in terms of license. However I have not seen anything conclusive or definitive on this.

Wiping your Mac

Sometimes you need to wipe your Mac and know that it is wiped and clean for someone else to use. In this case, have a read of What to do before you sell or give away your Mac - Apple Support.

Recovering your Mac

So, after wiping your Mac above, you will probably want reset it. In which case, just after hitting the power button press and hold down Cmd+R and the recovery console will appear or for a wiped Mac, it will ask for a wireless network and then start setting things up.

External Display

With my newer MacBook Pro it only had USB-C connectors and hence I needed an adapter to connect it to external displays. When doing this macOS defaults to "Default for display", which in my experience is some low resolution that is not usable, hence the "Scaled" option is much better. However sometimes the list of choices is very limited and not what you know to be the native resolution of the device. In which case, switch back to "Default for display" and then press and hold the "Option" key while clicking "Scaled", then macOS will show you a much greater range of options for the resolution. Simple, when you know how.

Dashboard

The macOS Dashboard seems to have lovers and haters. I think it is okay, however my issue was I could not close it! I opened the "Launchpad" and clicked "Dashboard" and then it appears as a "space" but not one you can close, for some reason, well done Apple! The only way I have found to close it is to open "System Preferences" from the Apple menu, open "Mission Control" and set Dashboard to Off rather than Space and then it goes.

Certificates

If you want to see what certificates you have installed and for what purpose then load "Keychain Access". In the "Launchpad" this is under "Other" but can you just start typing to search for it. if you just want to see the trusted root certificates then use /System/Library/Security/Certificates.bundle/Contents/Resources/TrustStore.html in your browser, although your browser may not open that link for security reasons.

WiFi Issues

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!

Updates

When doing a macOS upgrade I suggest you allow an hour and are plugged into the mains before you start.

Generally macOS updates work smoothly, however after upgrading from macOS High Sierra to macOS Mojave I found that git stopped working. It seems you need to accept the license agreement again. To get git working again I needed to do the following:
xcode-select --install
This worked fine for me and fixed the problem, although some people suggest they needed "xcode-select --reset" instead.

Time Machine

I have not used Time Machine for backing up, myself. However I noticed recently a friend could not restore his backup due to some apps producing corrupt App Store receipt files, which in 2018 Time Machine did not handle gracefully during restore, it would just stop. The solution is at Solution for Time Machine ‘error while restoring from the backup’ | Harry Fear's Blog which goes through how you access and modify a backup.