Introduction
Setting up a development environment on macOS can be complex but rewarding. This guide walks you through the essential steps to prepare your macOS for mobile programming, focusing on tools like Homebrew, ZSH, and version managers.
Understanding macOS Chip Architectures
Apple Silicon (ARM)
Apple Silicon chips (e.g., M1, M2) offer high performance and energy efficiency. They are the default architecture for newer Macs.
Intel-Core (x86-64)
Older Macs use Intel chips. Many applications still support this architecture, but performance may vary.
How to Check Your Mac’s Chip Type
- Click the Apple Menu and select About This Mac.
- Look for the Processor or Chip information.
Command-Line Tools provide essential utilities like git and curl. Install them using:
Homebrew
Homebrew is a package manager for macOS. Install it using:
1
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
|
After installation, you can install packages with:
1
| brew install <package_name>
|
Enhancing the Terminal with ZSH Plugins
ZSH is the default shell on macOS. Enhance it with Oh-My-Zsh and plugins like zsh-syntax-highlighting and zsh-autosuggestions.
Install Oh-My-Zsh
1
| sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
|
Add Plugins
- Clone the plugins:
1
2
| git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
- Edit
~/.zshrc to include the plugins:
1
2
3
4
5
| plugins=(
git
zsh-autosuggestions
zsh-syntax-highlighting
)
|
- Restart the terminal or run:
Managing Programming Language Versions
Node.js with NVM
Install NVM using:
Add the following to ~/.zshrc:
1
2
| export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
|
Common NVM Commands
- Install the latest version of Node.js:
- Install a specific version:
Conclusion
This guide covers the foundational tools for setting up a macOS development environment. In Part 2, we’ll dive into installing Xcode, Android Studio, and Flutter.