Setting Up Expo Local iOS Builds on a Fresh Mac
If you're working with Expo and want to run local iOS builds instead of using EAS Build, you'll need to set up a few dependencies on your Mac first. I recently went through this process on a fresh machine and ran into several errors along the way. Here's everything you need to get it working.
Looking for Android instead? Check out Setting Up Expo Local Android Builds on a Fresh Mac.
Prerequisites
Before running your first local build, install CocoaPods and Fastlane via Homebrew:
brew install cocoapods
brew install fastlane
You also need Xcode installed from the App Store. Once installed, make sure the command line tools point to the full Xcode app (not just the Command Line Tools):
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Common Errors and Fixes
Fastlane is not available
Error:
bash
Fastlane is not available, make sure it's installed and in your PATH
spawn fastlane ENOENT
Error: spawn fastlane ENOENT
Fix:
Install Fastlane with Homebrew:
brew install fastlane
xcodebuild requires Xcode
Error:
bash
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory
'/Library/Developer/CommandLineTools' is a command line tools instance
Fix:
Point xcode-select to your Xcode installation:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
This error happens when you have the Command Line Tools installed but haven't told macOS to use the full Xcode app for builds.
Certificate is not trusted
Error:
Getting a "certificate is not trusted" error for your iOS Distribution Certificate.
Fix:
You need to import Apple's intermediate certificate into your system keychain:
curl -O https://www.apple.com/certificateauthority/AppleWWDRCAG3.cer
sudo security import AppleWWDRCAG3.cer -k /Library/Keychains/System.keychain
This downloads Apple's Worldwide Developer Relations Certificate Authority G3 certificate and adds it to your system keychain. After running these commands, your distribution certificate should be trusted.
See this GitHub issue for more context.
Running the Build
Once everything is set up, you can run a local iOS build with:
npx eas build --platform ios --profile development --local