Skip to content

Instantly share code, notes, and snippets.

@farseenmanekhan1232
Created February 10, 2026 09:26
Show Gist options
  • Select an option

  • Save farseenmanekhan1232/7221505533dcba20bab0fa092b7e629b to your computer and use it in GitHub Desktop.

Select an option

Save farseenmanekhan1232/7221505533dcba20bab0fa092b7e629b to your computer and use it in GitHub Desktop.

macOS Setup for Local EAS Builds

Complete guide for setting up macOS to build React Native/Expo apps locally using EAS CLI.

Prerequisites

  • macOS (tested on macOS Sonoma/Sequoia)
  • Node.js and npm installed
  • Homebrew installed

Installation

1. Install EAS CLI (Global)

npm install -g eas-cli

2. Install Android Development Tools

# Install Zulu Java 17 JDK (required for React Native)
brew install --cask zulu@17

# Install Android Studio
brew install --cask android-studio

Note: Open Android Studio at least once to complete SDK setup.

3. Install iOS Development Tools

# Install Xcode Command Line Tools
xcode-select --install

# Install CocoaPods
sudo gem install cocoapods

# Install Fastlane (used internally by EAS)
brew install fastlane

Note: Install Xcode from the Mac App Store (~12GB).

Environment Configuration

Add to your ~/.zshrc:

# Android SDK
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin

# Java 17
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH

# Fastlane
export PATH=$HOME/.local/share/fastlane/4.0.0/bin:$PATH

Reload shell:

source ~/.zshrc

Usage

Build Script

Create deploy-local.sh in your Expo project:

#!/bin/bash
set -e

PLATFORM=${1:-"both"}

if [ "$PLATFORM" != "i" ] && [ "$PLATFORM" != "a" ] && [ "$PLATFORM" != "both" ]; then
    echo "❌ Invalid platform: $PLATFORM"
    echo "   Usage: ./deploy-local.sh [platform]"
    echo "   i    - iOS only"
    echo "   a    - Android only"
    echo "   (no arg) - Both platforms"
    exit 1
fi

echo "πŸš€ Starting Local Deployment..."

# Java 17 for Android builds
export JAVA_HOME=/Library/Java/JavaVirtualMachines/zulu-17.jdk/Contents/Home
export GRADLE_OPTS="-Xmx4g -XX:MaxMetaspaceSize=1g"

echo "β˜• Using Java: $JAVA_HOME"
echo "πŸ“Š Gradle memory: $GRADLE_OPTS"

# iOS Build
if [ "$PLATFORM" == "i" ] || [ "$PLATFORM" == "both" ]; then
    echo "🍎 Building iOS (Local)..."
    eas build --platform ios --profile production --local --output ios-build.ipa
    
    echo "πŸ“€ Submitting iOS to App Store Connect..."
    eas submit --platform ios --path ios-build.ipa
    
    rm ios-build.ipa
    echo "βœ… iOS done!"
fi

# Android Build
if [ "$PLATFORM" == "a" ] || [ "$PLATFORM" == "both" ]; then
    echo "πŸ€– Building Android (Local)..."
    eas build --platform android --profile production --local --output android-build.aab
    
    echo "πŸ“€ Submitting Android to Google Play..."
    eas submit --platform android --path android-build.aab
    
    rm android-build.aab
    echo "βœ… Android done!"
fi

echo "✨ All done!"

Make it executable:

chmod +x deploy-local.sh

Running Builds

# Build both platforms
./deploy-local.sh

# Build iOS only
./deploy-local.sh i

# Build Android only
./deploy-local.sh a

Verification

Check installations:

# EAS CLI
eas --version

# Java
java -version

# Fastlane
fastlane --version

# CocoaPods
pod --version

# Android SDK
ls $ANDROID_HOME

Troubleshooting

Java Not Found

Ensure Zulu Java 17 is installed:

brew install --cask zulu@17

Android SDK Not Found

Open Android Studio and complete initial setup, then verify:

ls ~/Library/Android/sdk

CocoaPods Errors

Update CocoaPods:

sudo gem install cocoapods

EAS Login Required

eas login

Project Requirements

Ensure your eas.json has local build profiles:

{
  "cli": {
    "version": ">= 5.0.0"
  },
  "build": {
    "production": {
      "android": {
        "buildType": "app-bundle"
      },
      "ios": {
        "buildConfiguration": "Release"
      }
    }
  },
  "submit": {
    "production": {}
  }
}

Summary

Component Purpose
EAS CLI Main build orchestration
Fastlane Internal iOS/Android build tools
Java 17 Android builds requirement
Android Studio Android SDK & emulator
Xcode iOS builds & simulator
CocoaPods iOS dependency management

License

This setup guide is for educational purposes. Ensure you have appropriate licenses for all tools (Xcode requires Apple Developer account for distribution).

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