Setup Development Environment on a New macOS

Install Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Common Issue

Warning: /opt/homebrew/bin is not in your PATH

To resolve this, add Homebrew’s bin directory to your PATH:

vim ~/.zshrc
export PATH=/opt/homebrew/bin:$PATH
:wq
source ~/.zshrc

Refer to this StackOverflow thread for more details.

Install Git

brew install git

Setup Git Email & Name

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

Setup Git Alias

git config --global alias.co checkout
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.br branch

Install iTerm2

brew tap homebrew/cask
brew install --cask iterm2

Switch from the default Terminal to iTerm2.

iTerm2 + Zsh Setup

Install Zsh

brew install zsh

Install Oh-My-Zsh

sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Setup Colors

Navigate to Preferences -> Profiles -> Colors -> Select ‘Solarized’.

Install Fonts

brew tap homebrew/cask-fonts
brew search font-meslo-lg-nerd-font
brew install --cask font-meslo-lg-nerd-font

Set your terminal font to font-meslo-lg-nerd-font in Preferences.

Install Powerlevel10k Theme

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Update your ~/.zshrc to use Powerlevel10k:

ZSH_THEME="powerlevel10k/powerlevel10k"

Run the following to configure the theme:

p10k configure

Install Zsh-Syntax-Highlighting

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Activate the plugin in ~/.zshrc:

plugins=(... zsh-syntax-highlighting)

Install Zsh-Autosuggestions

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Activate the plugin in ~/.zshrc:

plugins=(... zsh-autosuggestions)

Restart your terminal to apply changes.

iOS Environment: Install Xcode

Install Xcodes Tool

brew install robotsandpencils/made/xcodes

Common Issue

error: terminated(72): /usr/bin/xcrun --sdk macosx --find xctest output:
    xcrun: error: unable to find utility "xctest", not a developer tool or in PATH

Refer to this GitHub issue for resolution.

Alternative: Use XcodesApp

If issues persist, download Xcode via the App Store.

Install JetBrains Toolbox

brew install --cask jetbrains-toolbox

Use JetBrains Toolbox to manage IDEs like Android Studio, IntelliJ IDEA, and PyCharm.

Install OpenJDK

brew install openjdk@11

Add OpenJDK to your PATH:

echo 'export PATH="/opt/homebrew/opt/openjdk@11/bin:$PATH"' >> ~/.zshrc

For compilers, set:

export CPPFLAGS="-I/opt/homebrew/opt/openjdk@11/include"

SSH Key Setup

Create unique keys for each platform (e.g., GitHub, GitLab).

GitHub

Follow GitHub’s guide.

GitLab

Follow GitLab’s SSH setup guide.

Android Build Issue

Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64

Refer to this StackOverflow solution.


🎉 Your macOS development environment setup is complete!

Leave a comment