Skip to content

Instantly share code, notes, and snippets.

@brianjbayer
Created November 19, 2023 23:38
Show Gist options
  • Save brianjbayer/222bdbde2a9753facae0edbb073587f4 to your computer and use it in GitHub Desktop.
Save brianjbayer/222bdbde2a9753facae0edbb073587f4 to your computer and use it in GitHub Desktop.
How to setup a basic development environment on Mac

Set Up a Mac Development Environment (Sonoma 14)

This guide helps you set up the fundamentals needed for software development on macOS. This enables you to install your own language/framework specific development environment (such as Ruby/Rails, Python etc.)

This guide is optimized by following the minimum critical path to get you up and running.

πŸ•’ This was last done on macOS Sonoma (14.1) on Apple M2 Pro 16" 2023 MacBook Pro


PREREQUISITES

Before getting started, especially if this is a straight out-of-the-box Mac, you should...

  • Have your Wifi Password, you will need it to connect and install software

  • πŸ™„ "Bounce" (power off, wait, power on) your WiFi network, especially if this a straight out-of-the-box Mac or if you are having connectivity issues with the machine or with the Apple App Store

    πŸ‘½ As weird as this sounds about the WiFi, I can say that it did fix an issue that I was having with a new 2023 M2 Pro MacBookPro unable to connect to the App Store. I just happened to get an Apple Senior Technical Support Specialist who knew about this and convinced me to try it. He said that he sees it happen all the time if there are multiple Macs on the network.

These are all of the things that you will need to supply to setup your basic Mac development environment...

YOU WILL NEED YOUR... IN ORDER TO...
WiFi Network Name Setup Wizard
WiFi Password Setup Wizard
Full Name Setup Wizard
Mac Account Name Setup Wizard (default based on Full Name)
Mac Password Setup Wizard
Mac Password Hint Setup Wizard
Apple ID Install Xcode
Git User Name Configure Git Globals
Git Email Configure Git Globals, Add an SSH Key

Setup Wizard / Create Your Account

If this is a "clean" system, you will need to follow the setup wizard and create an account on your Mac.

For your new account, you will need to supply...

  1. Full Name
  2. Mac Account Name (will default based on Full name)
  3. Mac Password
  4. Mac Password Hint

🎱 You can edit and change and customize your account Icon while creating your account

πŸ•› You will probably want to select Set time zone based on current location


Follow the links below in the order they are listed to complete setting up your basic Mac dev environment...

1. Update the System

Generally the factory-installed version of the operating system on a new Mac is not the most recent and should be updated to better ensure a smooth setup.

2. Customize Your Mac

Once you are at the latest system software, customize your Mac.


3. Install Xcode

You will need to install the Apple Xcode developer tools application from the App Store.

πŸ”’ You will need an Apple ID to sign into the App Store to download XCode

  • Install Xcode

  • Install any other applications from the App Store, I like Skitch for screen capture

    • If using Skitch's default Shift (⇧), Command (⌘), and 5 keyboard shortcut, you will need to disable the default Mac screenshot in System Settings > Keyboard > Keyboard Shortcuts... button > Screenshots and unselect Screenshot and recording options(⇧ ⌘ 5)

4. Install Homebrew

Homebrew is a package manager for Mac. You use it to install programs and utilities needed for development as well as applications such as Chrome, Docker, VS Code etc.

✨ The Homebrew install script will start by installing (XCode) Command Line Tools which includes the gcc compiler

Installing Homebrew Activates git

Once Homebrew is installed, you will have git available.

There will not be any configuration or credentials but you do have https access to public repositories. You can keep basic configuration and setup scripts to automate your setup from here.


5. Configure Your User Profile (~/.zshrc)

βš™οΈ You can now use an automated script to configure your user profile. I use a GitHub repository :octocat: mac-dev-zsh-profile that does this. You are welcome to use it if you'd like.

Now that you have finished installing all of the critical apps that require GUI interactions and Homebrew, it is really helpful to have your user profile ~/.zshrc setup. This will give you your aliases, paths, environment, etc.


βš™οΈ You can use automated setup scripts to configure and install. I use a GitHub repository :octocat: mac-setup that automates the rest of these tasks. You are welcome to use it if you'd like.


6. Configure Your Git Globals

Now that you have at least a basic user profile with Homebrew, the nest step is to configure your git.

7. Add an SSH Key

If you are using a remote source code repository and/or connecting to remote servers, you will probably need to create and add an SSH Key. Generating it on your Mac and adding the public version to the remote host.


8. Install Development Applications Using Homebrew

You can use Homebrew to install and manage your applications such as Chrome, Firefox, Docker, VS Code, etc.

9. Install Git and Vim (with Janus: Vim Distribution) Using Homebrew

You can use Homebrew to install and manage your development tools such as git and vim, etc.


What's Next?

This should now give you a basic Mac development environment to add your own tools, languages, frameworks, and customizations.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment