home / skills / thebushidocollective / han / expo-build

This skill helps you build and deploy Expo apps with EAS Build, managing profiles, secrets, and app store submission end-to-end.

npx playbooks add skill thebushidocollective/han --skill expo-build

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
4.5 KB
---
name: expo-build
user-invocable: false
description: Use when building and deploying Expo apps with EAS Build. Covers build configuration, development builds, production builds, and app store submission.
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Grep
  - Glob
---

# Expo Build with EAS

Use this skill when building and deploying Expo applications using EAS (Expo Application Services) Build.

## Key Concepts

### EAS Build Configuration

```json
// eas.json
{
  "cli": {
    "version": ">= 5.9.0"
  },
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "ios": {
        "simulator": true
      }
    },
    "preview": {
      "distribution": "internal"
    },
    "production": {
      "autoIncrement": true
    }
  },
  "submit": {
    "production": {}
  }
}
```

### Build Commands

```bash
# Development build
eas build --profile development --platform ios
eas build --profile development --platform android

# Preview build
eas build --profile preview --platform all

# Production build
eas build --profile production --platform all

# Local build
eas build --profile production --platform ios --local
```

### Development Builds

```json
{
  "build": {
    "development": {
      "developmentClient": true,
      "distribution": "internal",
      "env": {
        "NODE_ENV": "development"
      }
    }
  }
}
```

## Best Practices

### Environment Variables

```json
// eas.json
{
  "build": {
    "production": {
      "env": {
        "APP_ENV": "production",
        "API_URL": "https://api.myapp.com"
      }
    },
    "staging": {
      "env": {
        "APP_ENV": "staging",
        "API_URL": "https://staging-api.myapp.com"
      }
    }
  }
}
```

### Secrets Management

```bash
# Set secrets
eas secret:create --scope project --name API_KEY --value your_api_key
eas secret:create --scope project --name GOOGLE_SERVICES_JSON --value "$(cat google-services.json)" --type file

# List secrets
eas secret:list

# Use in eas.json
{
  "build": {
    "production": {
      "env": {
        "API_KEY": "$(EAS_SECRET_API_KEY)"
      }
    }
  }
}
```

### Version Management

```json
// eas.json
{
  "build": {
    "production": {
      "autoIncrement": true,
      "ios": {
        "buildNumber": "1"
      },
      "android": {
        "versionCode": 1
      }
    }
  }
}
```

### Build Hooks

```json
{
  "build": {
    "production": {
      "prebuild": "npm run generate-assets",
      "postbuild": "npm run cleanup"
    }
  }
}
```

## Common Patterns

### Multi-Environment Builds

```json
// eas.json
{
  "build": {
    "development": {
      "developmentClient": true,
      "channel": "development",
      "distribution": "internal"
    },
    "staging": {
      "channel": "staging",
      "distribution": "internal",
      "ios": {
        "bundleIdentifier": "com.myapp.staging"
      },
      "android": {
        "package": "com.myapp.staging"
      }
    },
    "production": {
      "channel": "production",
      "autoIncrement": true
    }
  }
}
```

### Custom Native Code

```json
{
  "build": {
    "production": {
      "ios": {
        "buildConfiguration": "Release"
      },
      "android": {
        "gradleCommand": ":app:bundleRelease"
      }
    }
  }
}
```

### App Store Submission

```bash
# iOS
eas submit --platform ios

# Android
eas submit --platform android

# Configure submission
# eas.json
{
  "submit": {
    "production": {
      "ios": {
        "appleId": "[email protected]",
        "ascAppId": "1234567890",
        "appleTeamId": "AB12CD34EF"
      },
      "android": {
        "serviceAccountKeyPath": "./service-account.json",
        "track": "production"
      }
    }
  }
}
```

### Build Monitoring

```bash
# View build status
eas build:list

# View specific build
eas build:view [build-id]

# Cancel build
eas build:cancel [build-id]
```

## Anti-Patterns

### Don't Commit Secrets

```json
// Bad - Secrets in eas.json
{
  "build": {
    "production": {
      "env": {
        "API_KEY": "sk_live_1234567890"
      }
    }
  }
}

// Good - Use EAS Secrets
eas secret:create --scope project --name API_KEY --value sk_live_1234567890
```

### Don't Skip Version Increments

```json
// Bad - Manual version management
{
  "build": {
    "production": {
      "autoIncrement": false
    }
  }
}

// Good - Auto increment
{
  "build": {
    "production": {
      "autoIncrement": true
    }
  }
}
```

## Related Skills

- **expo-config**: Configuring app for builds
- **expo-updates**: OTA updates after builds

Overview

This skill helps build and deploy Expo apps using EAS Build, covering development, preview, and production profiles as well as submission to app stores. It consolidates best practices for environment variables, secrets, versioning, build hooks, and monitoring to streamline reliable releases. Use it to standardize eas.json configuration and common build commands across environments.

How this skill works

The skill inspects and recommends EAS build profiles, environment and secret usage, versioning settings, and build hooks to ensure reproducible builds. It highlights commands for development, preview, production, local builds, and submit flows, and surfaces anti-patterns like committing secrets or skipping version increments. It also guides monitoring and submission configuration for iOS and Android.

When to use it

  • Setting up EAS build profiles (development, staging, production).
  • Preparing CI/CD pipelines that trigger EAS builds and submissions.
  • Managing environment variables and secrets safely for different environments.
  • Configuring version management and auto-increment for releases.
  • Debugging build failures and monitoring build status or cancelling builds.

Best practices

  • Keep eas.json profiles minimal and environment-specific; avoid hardcoding secrets.
  • Use eas secret:create for sensitive values and reference them via EAS_SECRET_* in eas.json.
  • Enable autoIncrement for production builds to prevent App Store or Play Store rejections.
  • Use build hooks (prebuild/postbuild) to generate assets or run cleanup steps reproducibly.
  • Use named channels for multi-environment releases (development, staging, production) and distinct bundle identifiers/packages.

Example use cases

  • Create a development profile with developmentClient true for local debugging and installing dev clients on devices.
  • Define staging and production profiles with separate API_URL env values and bundle identifiers for parallel installs.
  • Add prebuild hooks to generate code or assets and postbuild hooks to remove temporary files before signing.
  • Use eas submit with configured appleId/ascAppId or serviceAccountKeyPath to automate store submissions.
  • Store service account JSON and other files as EAS secrets and reference them in release profiles.

FAQ

How do I pass API keys to builds securely?

Create project-scoped EAS secrets with eas secret:create and reference them in eas.json using the EAS_SECRET_* syntax instead of embedding keys in version control.

When should I use developmentClient=true?

Use developmentClient in development profiles when you need a custom dev client for debugging native modules or for iterative local testing; keep production profiles without it.