$npx -y skills add greenstevester/fastlane-skill --skill betaBuild and upload iOS app to TestFlight
| 1 | ## TestFlight Beta Release |
| 2 | |
| 3 | Build and upload the iOS app to TestFlight for beta testing. |
| 4 | |
| 5 | ### Pre-flight Checks |
| 6 | - Fastlane installed: !`fastlane --version 2>/dev/null | grep "fastlane " | head -1 || echo "✗ Not installed - run: brew install fastlane"` |
| 7 | - Fastfile exists: !`ls fastlane/Fastfile 2>/dev/null && echo "✓ Found" || echo "✗ Not found - run /setup-fastlane first"` |
| 8 | - App-specific password: !`[ -n "$FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD" ] && echo "✓ Set" || echo "⚠️ Not set - export FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD='xxxx-xxxx-xxxx-xxxx'"` |
| 9 | |
| 10 | ### Arguments: ${ARGUMENTS:-none} |
| 11 | |
| 12 | --- |
| 13 | |
| 14 | ## What This Does |
| 15 | |
| 16 | 1. **Syncs certificates** via Match (appstore type) — *only once you've run the `match` skill; the base `setup-fastlane` lane skips this* |
| 17 | 2. **Increments build number** (unless `--skip-build-increment`) |
| 18 | 3. **Builds release archive** with gym |
| 19 | 4. **Uploads to TestFlight** via pilot |
| 20 | 5. **Optionally distributes to external testers** (via the separate `beta_external` lane) |
| 21 | |
| 22 | --- |
| 23 | |
| 24 | ## Commands |
| 25 | |
| 26 | ### Standard Beta (Internal Testers) |
| 27 | Run from your project directory (where `fastlane/` lives): |
| 28 | ```bash |
| 29 | fastlane beta |
| 30 | ``` |
| 31 | |
| 32 | ### Skip Build Number Increment |
| 33 | ```bash |
| 34 | fastlane beta skip_build_increment:true |
| 35 | ``` |
| 36 | |
| 37 | ### External Testers (with changelog) |
| 38 | ```bash |
| 39 | fastlane beta_external changelog:"Bug fixes and performance improvements" |
| 40 | ``` |
| 41 | |
| 42 | --- |
| 43 | |
| 44 | ## Troubleshooting |
| 45 | |
| 46 | ### "No value found for 'username'" |
| 47 | Set your Apple ID in `fastlane/Appfile`: |
| 48 | ```ruby |
| 49 | apple_id("your@email.com") |
| 50 | ``` |
| 51 | |
| 52 | ### "Please sign in with an app-specific password" |
| 53 | 1. Go to https://account.apple.com → Sign-In & Security → App-Specific Passwords |
| 54 | 2. Generate a password named "Fastlane" |
| 55 | 3. Export it: |
| 56 | ```bash |
| 57 | export FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD='xxxx-xxxx-xxxx-xxxx' |
| 58 | ``` |
| 59 | |
| 60 | ### rsync error during export |
| 61 | If you see `--extended-attributes: unknown option`, Homebrew rsync conflicts with Xcode: |
| 62 | ```bash |
| 63 | brew uninstall rsync # Use system rsync |
| 64 | ``` |
| 65 | |
| 66 | --- |
| 67 | |
| 68 | ## After Upload |
| 69 | |
| 70 | - Build will appear in TestFlight within 1-5 minutes |
| 71 | - Internal testers are notified automatically |
| 72 | - External testers require `beta_external` lane or manual distribution in App Store Connect |