How to set up local Chromium development environment on macOS in 2025
How to Set Up Local Chromium Development Environment on macOS in 2025
Many developers attempting to contribute to Chromium or build custom browser versions make a critical mistake right at the start: using git clone to grab the source code. The official Chromium repository uses a specialized workflow that requires depot_tools, a custom toolset that handles dependencies, syncing, and building far differently than standard Git repositories.
If you're on macOS and want to properly set up a local Chromium development environment, this guide walks you through the correct approach, common pitfalls, and how to get your first build running.
Why You Can't Just Use Git Clone
The Chromium source code is massive—over 2 million files and several hundred thousand commits. It also has intricate cross-platform dependencies, third-party libraries, and build configurations that regular Git can't manage efficiently.
Instead, the Chromium team uses depot_tools, a collection of Python and shell scripts that handle:
- gclient: Manages code dependencies and syncing
- gn: Google's meta build system (replaces gyp)
- ninja: Fast parallel build system
- git: Version control with depot_tools extensions
Using depot_tools ensures you get the correct versions of all dependencies and can successfully build on your platform.
Prerequisites for macOS
Before starting, ensure you have:
- macOS 10.15+ (Big Sur, Monterey, or newer recommended)
- Xcode Command Line Tools:
xcode-select --install - Python 3.8+: Verify with
python3 --version - Git:
git --version - At least 30 GB free disk space (for full checkout and build artifacts)
- Homebrew (optional but helpful):
brew --version
Step-by-Step Setup Process
Step 1: Install depot_tools
First, clone the depot_tools repository into a directory of your choice:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$HOME/depot_tools:$PATH"
Make this permanent by adding it to your shell profile:
echo 'export PATH="$HOME/depot_tools:$PATH"' >> ~/.zshrc
source ~/.zshrc
Verify installation:
depot_tools --version
Step 2: Create a Working Directory
Chromium needs its own directory structure. Create it:
mkdir -p ~/chromium-workspace
cd ~/chromium-workspace
Step 3: Fetch the Chromium Source Code
This is where most developers go wrong. Use fetch from depot_tools, not git clone:
fetch chromium
This command:
- Downloads the Chromium source repository
- Initializes submodules and dependencies
- Creates a
.gclientconfiguration file - Sets up the correct Git remotes
On a 100 Mbps connection, this takes 30-60 minutes and consumes ~5-10 GB initially.
Step 4: Sync and Update Dependencies
Once fetch completes, navigate into the chromium directory and sync:
cd chromium/src
gclient sync
This ensures all dependencies match the current state of the repository.
Step 5: Configure Your Build
Generate build files using GN. For a debug build (faster compilation, better debugging):
gn gen out/Default
For a release build (faster runtime, slower compilation):
gn gen out/Release --args='is_debug=false'
You can also customize build arguments:
gn gen out/Custom --args='is_debug=false is_component_build=true'
View available arguments:
gn args out/Default --list
Step 6: Build Chromium
Build your configured target using ninja:
ninj -C out/Default chrome
On macOS with modern hardware (8+ cores), this takes 20-40 minutes for an initial build.
Monitor progress with:
ninj -C out/Default chrome -v # Verbose output
Step 7: Run Your Build
Launch the compiled browser:
out/Default/Chromium.app/Contents/MacOS/Chromium
Common macOS-Specific Issues
Issue: "xcrun: error: unable to find utility"
Solution: Install Xcode Command Line Tools:
xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools
Issue: Python 2 vs Python 3 Conflicts
Chromium requires Python 3 for depot_tools. If you have Python 2 installed:
# Verify Python 3 path
which python3
# Create alias in ~/.zshrc if needed
alias python=python3
Issue: Permission Denied on First Run
MacOS may block execution of the unsigned build:
xattr -d com.apple.quarantine out/Default/Chromium.app
Keeping Your Checkout Updated
Chromium has thousands of commits daily. Keep your local copy synced:
cd ~/chromium-workspace/chromium/src
git pull origin main
gclient sync
For release branch (more stable, less frequent updates):
git checkout -b release-branch-local origin/release-branch
gclient sync
Common Build Arguments Comparison
| Argument | Effect | Build Time | Runtime | Use Case |
|----------|--------|-----------|---------|----------|
| is_debug=true (default) | Full symbols, assertions | 20-40 min | Slower | Development, debugging |
| is_debug=false | Optimized, minimal symbols | 30-50 min | Faster | Performance testing |
| is_component_build=true | Shared libraries | ~15 min | Fast iteration | Rapid iteration |
| symbol_level=0 | No debug symbols | ~20 min | Fastest | Release builds |
Troubleshooting Build Failures
Build fails with dependency errors:
# Clean and re-sync
rm -rf out/Default
gclient sync --force
gn gen out/Default
ninj -C out/Default chrome
Out of disk space during build:
Chromium can grow to 50+ GB with artifacts. Monitor with:
du -sh ~/chromium-workspace/chromium
Clean intermediate files:
ninj -C out/Default -t clean
Next Steps
Once you have a working build:
- Read the Developer Docs: Review docs/README.md in your source checkout
- Explore Architecture: Study how to navigate the source structure
- Make Changes: Edit source files, rebuild with
ninj -C out/Default chrome - Report Bugs: File issues at crbug.com/new
- Contribute: Follow the contribution guidelines
With this setup, you're ready to develop, debug, and contribute to Chromium on macOS.