Home

Productive Mac Development for New Developers

February 6, 2017

If you’re new to the world of software development you are probably focused on learning a specific language, framework or tech stack. But another important skill for developers is being a productive developer. This means working with speed and ease.

Fortunately there are a number of shortcuts, tools and techniques on the Mac that you can use to improve your productivity.

Navigating Applications

Start Applications Quickly

There are a few ways to start applications on your computer such as the Dock, Launchpad or Finder, but I’m going to show you the quickest way:

Spotlight

This is much faster than using the other methods listed above and we’ll be using this technique moving forward.

If you decide you don’t actually want to start another application just tap the esc key (twice if you started typing something) and the Spotlight window will go away.

Switch Applications Quickly

While you can certainly use the Dock to switch applications, there’s a keyboard shortcut we can use to achieve the same thing without having to grab our mouse or locate the pointer.

Quit Applications Quickly

To quickly close the active application (such as the System Properties we just opened), hold down the Command key (⌘) and tap Q.

Taking Control of Your Mac

Ensure you have Admin Rights

Let’s make sure you have the ability to administer your computer. You will need this ability to install certain programs and run certain commands.

Users and groups

If the checkbox is unchecked and grayed out then look at the list of names on the left side and see if anybody has Admin under their name. You’ll need to ask them to give you Admin rights on your (their?) computer.

Clean Up Your Login Items

While you still have Users & Groups open (use Spotlight again if you already closed it) lets remove any applications you don’t need to have running every time you start your Mac.

Examples of Applications you likely want to remove are:

Ensure you have an App Store Account

Next we want to make sure you have an App Store account. You’ll need this to upgrade macOS and install XCode, which we’ll be doing in a little bit:

Ensure your Operating System is up to date

It’s time to make sure you have the latest version of macOS installed.

Warning: You should do the usual OS upgrade stuff like making sure you have a backup of your machine first!

Download macOS Sierra from the App Store and upgrade your computer.

Restart Your Computer

If you upgraded macOS then you’ve most definitely restarted your computer. If not, now would be a good time to do that.

Restarting your computer will ensure that all programs are shut down and you’re starting fresh with nothing already running, such as the Login Items we removed earlier.

Once the machine restarts you should log in and have nothing running.

XCode

XCode is an Integrated Development Environment (IDE) used for building macOS, iOS, watchOS and tvOS apps. Even if you’re not planning to build apps for any of those platforms many other development tools rely on having XCode installed, so we should make sure you have the latest version installed.

Install XCode

Download XCode from the App Store and install it on your computer.

Agree to the XCode License

Now we need to agree to XCode License so that we can use the tools it provides:

What is sudo?

sudo is a command that lets you run commands as another user. By default that user is root which has access too all commands, directories and files on your computer. You should only have to use sudo very infrequently.

Use a Package Manager

While you are developing software you will likely need to install a number of additional packages and you want to be able to do that quickly with a minimum amount of button clicking and question answering - ideally none!

Packages can be:

Homebrew is a Package Manager you can use to install, update and manage packages on a Mac.

Install Homebrew

To install Homebrew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Once that completes you should have access to the brew command in Termal.

We’ll be using Homebrew in just a little bit to install a few applications and tools.

Keeping Homebrew Happy

It’s a good idea to run the following commands occassionally to keep Homebrew healthy and lean:

Using a Better Terminal Application

As you grow as a developer you will likely find yourself using the computer at a lower level than you have previously - you’ll be typing commands in a terminal window instead of clicking on windows, tabs and buttons.

An example of this is when you agreed to the XCode license and installed Homebrew above. This could have been done with XCode but it would’ve take much more clicking and waiting to accomplish.

And while Terminal certainly got the job done, we can do better. iTerm 2 is an arguably improved version of Terminal. At a minimum it looks much nicer than Terminal.

Install iTerm 2

We can install iTerm 2 using Homebrew:

Wasn’t that easier than:

When iTerm is done installing:

What is a Cask?

Homebrew uses a number terms inspired by the practice of brewing. In this case Cask is a special command you use specifically to install desktop (GUI) applications as opposed to command-line applications.

Make the Most of your Screen Real Estate

ShiftIt is a tool that lets you easily resize the current application’s window using the keyboard instead of the mouse.

For example: you can use it to set up your HTML editor on the left side of the screen and web browser on the right side of the screen without having to fuss with the mouse and trying to line things up perfectly

Install ShiftIt

You can install it using Homebrew:

brew cask install shiftit

Then use Spotlight to start ShiftIt. It will likely inform you that it needs some permissions to control your machine.

Giving ShiftIt Permissions

ShiftIt needs permission to control your computer. Let’s give it that permission.

  1. Use Spotlight to open your Security & Privacy preferences.
  2. Select the Privacy tab.
  3. In the left sidebar choose Accessibility.
  4. Click the lock in the lower left corner to make changes and enter your password.
  5. In the right-hand pane titled Allow the apps below to control your computer check the box next to ShiftIt.
  6. Quit your Security & Privacy preferences.
  7. Start ShiftIt again using Spotlight.

Using ShiftIt

You use ShiftIt by holding down Control, Option and Command at the same time and then pressing:

Automatically Hide the Dock

To get some more screen real estate for your apps you can set the Dock to automatically hide when your mouse isn’t near it:

This will hide the Dock if it isn’t already hidden. Now when you maximize a window using ShiftIt, it will fill the entire screen.

Automatically Hide the Menu Bar

To get even more screen real estate you can also hide the menubar if you’re running the latest version of macOS.

Be Kind to Your Eyes

Finally, while we’re on the topic of the screen, there’s a nice menu bar app called f.lux that will adjust the white point of your screen based on the time of day. This results in less harsh light pelting your eyes late in the evening.

$ brew cask install flux

Then start flux using Spotlight. You’ll find f.lux in your menu bar where you can adjust its preferences to your liking.

Comments