# iOS Build Process Quick Reference **Author**: Matthew Raymer **Date**: November 4, 2025 ## Two Different Test Apps **Important**: There are two different iOS test apps: 1. **Native iOS Development App** (`ios/App`) - Simple Capacitor app for quick plugin testing 2. **Vue 3 Test App** (`test-apps/daily-notification-test`) - Full-featured Vue 3 Capacitor app --- ## Vue 3 Test App (`test-apps/daily-notification-test`) ### 🚨 Critical Build Steps ```bash # 1. Build web assets npm run build # 2. Sync with iOS project npx cap sync ios # 3. Build iOS app cd ios/App xcodebuild -workspace App.xcworkspace \ -scheme App \ -configuration Debug \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 15 Pro' \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO # 4. Install and launch APP_PATH=$(find build/derivedData -name "*.app" -type d | head -1) xcrun simctl install booted "$APP_PATH" BUNDLE_ID=$(plutil -extract CFBundleIdentifier raw App/Info.plist) xcrun simctl launch booted "$BUNDLE_ID" ``` ### 🔄 Using Capacitor CLI (Simplest Method) ```bash cd test-apps/daily-notification-test # Build and run in one command npx cap run ios # This handles: # - Building web assets # - Syncing with iOS # - Building app # - Installing on simulator # - Launching app ``` ### 🛠️ Automated Build Script ```bash cd test-apps/daily-notification-test ./scripts/build-and-deploy-ios.sh ``` --- ## Native iOS Development App (`ios/App`) ### 🚨 Critical Build Steps ```bash # 1. Build plugin cd /path/to/daily-notification-plugin ./scripts/build-native.sh --platform ios # 2. Install CocoaPods dependencies cd ios pod install # 3. Build iOS app cd App xcodebuild -workspace App.xcworkspace \ -scheme App \ -configuration Debug \ -sdk iphonesimulator \ -destination 'platform=iOS Simulator,name=iPhone 15 Pro' \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO # 4. Install and launch APP_PATH=$(find build/derivedData -name "*.app" -type d | head -1) xcrun simctl install booted "$APP_PATH" BUNDLE_ID=$(plutil -extract CFBundleIdentifier raw App/Info.plist) xcrun simctl launch booted "$BUNDLE_ID" ``` ### 🛠️ Automated Build Script ```bash cd /path/to/daily-notification-plugin ./scripts/build-and-deploy-native-ios.sh ``` --- ## ⚠️ iOS-Specific Requirements **Prerequisites:** - macOS (required for iOS development) - Xcode installed (`xcode-select --install`) - CocoaPods installed (`gem install cocoapods`) - iOS Simulator runtime installed **Common Issues:** - Simulator not booted: `xcrun simctl boot "iPhone 15 Pro"` - CocoaPods not installed: `sudo gem install cocoapods` - Platform components missing: `xcodebuild -downloadPlatform iOS` ## 🔍 Verification Checklist After build, verify: ### For Vue 3 Test App: - [ ] Simulator is booted (`xcrun simctl list devices | grep Booted`) - [ ] CocoaPods dependencies installed (`cd ios && pod install`) - [ ] Web assets synced (`npx cap sync ios`) - [ ] App builds successfully (`xcodebuild ...`) - [ ] App installs on simulator (`xcrun simctl install`) - [ ] App launches (`xcrun simctl launch`) ### For Native iOS App: - [ ] Simulator is booted (`xcrun simctl list devices | grep Booted`) - [ ] Plugin built (`./scripts/build-native.sh --platform ios`) - [ ] CocoaPods dependencies installed (`cd ios && pod install`) - [ ] App builds successfully (`xcodebuild ...`) - [ ] App installs on simulator (`xcrun simctl install`) - [ ] App launches (`xcrun simctl launch`) ## 📱 Testing Commands ```bash # List available simulators xcrun simctl list devices available # Boot simulator xcrun simctl boot "iPhone 15 Pro" # Check if booted xcrun simctl list devices | grep Booted # View logs xcrun simctl spawn booted log stream # Uninstall app xcrun simctl uninstall booted com.timesafari.dailynotification.test # Vue 3 app xcrun simctl uninstall booted com.timesafari.dailynotification # Native app # Reset simulator xcrun simctl erase booted ``` ## 🐛 Common Issues | Issue | Symptom | Solution | |-------|---------|----------| | Simulator not found | `Unable to find destination` | Run `xcrun simctl list devices` to see available devices | | CocoaPods error | `pod: command not found` | Install CocoaPods: `gem install cocoapods` | | Build fails | `No such file or directory` | Run `pod install` in `ios/` directory | | Signing error | `Code signing required` | Add `CODE_SIGNING_REQUIRED=NO` to xcodebuild command | | App won't install | `Could not find application` | Verify app path exists and simulator is booted | | Vue app: assets not syncing | App shows blank screen | Run `npm run build && npx cap sync ios` | --- **Remember**: - **Native iOS App** (`ios/App`) = Quick plugin testing, no web build needed - **Vue 3 Test App** (`test-apps/...`) = Full testing with UI, requires `npm run build` Use `npx cap run ios` in the Vue 3 test app directory for the simplest workflow!