SKILL.md--- name: expo-build-deploy description: Building and deploying Expo React Native apps to iOS. Use when configuring EAS Build, submitting to TestFlight, App Store deployment, managing certificates, or troubleshooting build issues. --- # Expo Build & Deploy (iOS) ## EAS Build Setup ### Initial configuration ```bash # Install EAS CLI npm install -g eas-cli # Login to Expo account eas login # Initialize EAS in project eas build:configure ``` This creates `eas.json`: ```json { "cli": { "version": ">= 5.0.0" }, "build": { "development": { "developmentClient": true, "distribution": "internal", "ios": { "simulator": true } }, "preview": { "distribution": "internal" }, "production": {} }, "submit": { "production": {} } } ``` ### app.json iOS configuration ```json { "expo": { "name": "MyApp", "slug": "myapp", "version": "1.0.0", "scheme": "myapp", "ios": { "bundleIdentifier": "com.yourcompany.myapp", "buildNumber": "1", "supportsTablet": false, "infoPlist": { "NSCameraUsageDescription": "Take photos for your profile", "NSLocationWhenInUseUsageDescription": "Find locations near you" } } } } ``` ## Build Types ### Development build (for development) ```bash # For simulator eas build --profile development --platform ios # For physical device eas build --profile development --platform ios --local ``` Use with `npx expo start --dev-client` ### Preview build (internal testing) ```bash eas build --profile preview --platform ios ``` Distributes via ad-hoc provisioning. Testers install via link. ### Production build (App Store) ```bash eas build --profile production --platform ios ``` ## Credentials Management EAS manages credentials automatically, but you can control them: ```bash # View current credentials eas credentials # Let EAS manage everything (recommended) # Just run build, it handles certificates # Use existing credentials eas credentials --platform ios # Select "Use existing" and provide paths ``` ### Manual credential setup (if needed) 1. Create App ID in Apple Developer Portal 2. Create Distribution Certificate 3. Create Provisioning Profile 4. Configure in `eas.json`: ```json { "build": { "production": { "ios": { "credentialsSource": "local" } } } } ``` ## Environment Variables ### In eas.json ```json { "build": { "production": { "env": { "API_URL": "https://api.yourapp.com" } }, "preview": { "env": { "API_URL": "https://staging-api.yourapp.com" } } } } ``` ### Secrets (sensitive values) ```bash # Set secret eas secret:create --name API_KEY --value "sk_live_xxx" --scope project # List secrets eas secret:list # Use in app.json { "extra": { "apiKey": process.env.API_KEY } } ``` Access in code: ```typescript import Constants from 'expo-constants'; const apiKey = Constants.expoConfig?.extra?.apiKey; ``` ## TestFlight Deployment ### Configure submit profile ```json { "submit": { "production": { "ios": { "appleId": "your@email.com", "ascAppId": "1234567890",