# Viewing Build Errors - Full Output Guide **Author**: Matthew Raymer **Date**: November 4, 2025 ## Quick Methods to See Full Errors ### Method 1: Run Build Script and Check Log Files ```bash # Run the build script ./scripts/build-native.sh --platform ios # If it fails, check the log files: cat /tmp/xcodebuild_device.log # Device build errors cat /tmp/xcodebuild_simulator.log # Simulator build errors # View only errors: grep -E "(error:|warning:)" /tmp/xcodebuild_simulator.log ``` ### Method 2: Run xcodebuild Directly (No Script Filtering) ```bash # Build for simulator with full output cd ios xcodebuild -workspace DailyNotificationPlugin.xcworkspace \ -scheme DailyNotificationPlugin \ -configuration Debug \ -sdk iphonesimulator \ -destination 'generic/platform=iOS Simulator' \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ | tee build-output.log # Then view errors: grep -E "(error:|warning:)" build-output.log ``` ### Method 3: Redirect to File and View ```bash # Save full output to file ./scripts/build-native.sh --platform ios 2>&1 | tee build-full.log # View errors grep -E "(error:|warning:|ERROR|FAILED)" build-full.log # View last 100 lines tail -100 build-full.log ``` ### Method 4: Use xcodebuild with Verbose Output ```bash cd ios # Build with verbose output xcodebuild -workspace DailyNotificationPlugin.xcworkspace \ -scheme DailyNotificationPlugin \ -configuration Debug \ -sdk iphonesimulator \ -destination 'generic/platform=iOS Simulator' \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ -verbose \ 2>&1 | tee build-verbose.log # Extract just errors grep -E "^error:" build-verbose.log | head -50 ``` ## Filtering Output ### Show Only Errors ```bash # From log file grep -E "^error:" /tmp/xcodebuild_simulator.log # From live output ./scripts/build-native.sh --platform ios 2>&1 | grep -E "(error:|ERROR)" ``` ### Show Errors with Context (5 lines before/after) ```bash grep -E "(error:|warning:)" -A 5 -B 5 /tmp/xcodebuild_simulator.log | head -100 ``` ### Count Errors ```bash grep -c "error:" /tmp/xcodebuild_simulator.log ``` ### Show Errors Grouped by File ```bash grep "error:" /tmp/xcodebuild_simulator.log | cut -d: -f1-3 | sort | uniq -c | sort -rn ``` ## Common Error Patterns ### Swift Compilation Errors ```bash # Find all Swift compilation errors grep -E "\.swift.*error:" /tmp/xcodebuild_simulator.log # Find missing type errors grep -E "cannot find type.*in scope" /tmp/xcodebuild_simulator.log # Find import errors grep -E "No such module|Cannot find.*in scope" /tmp/xcodebuild_simulator.log ``` ### CocoaPods Errors ```bash # Find CocoaPods errors grep -E "(pod|CocoaPods)" /tmp/xcodebuild_simulator.log -i ``` ### Build System Errors ```bash # Find build system errors grep -E "(BUILD FAILED|error:)" /tmp/xcodebuild_simulator.log ``` ## Debugging Tips ### See Full Command Being Run Add `set -x` at the top of the script, or run: ```bash bash -x ./scripts/build-native.sh --platform ios 2>&1 | tee build-debug.log ``` ### Check Exit Codes ```bash ./scripts/build-native.sh --platform ios echo "Exit code: $?" ``` ### View Build Settings ```bash cd ios xcodebuild -workspace DailyNotificationPlugin.xcworkspace \ -scheme DailyNotificationPlugin \ -showBuildSettings 2>&1 | grep -E "(SWIFT|FRAMEWORK|HEADER)" ``` ## Example: Full Debug Session ```bash # 1. Run build and save everything ./scripts/build-native.sh --platform ios 2>&1 | tee build-full.log # 2. Check exit code echo "Build exit code: $?" # 3. Extract errors echo "=== ERRORS ===" > errors.txt grep -E "(error:|ERROR)" build-full.log >> errors.txt # 4. Extract warnings echo "=== WARNINGS ===" >> errors.txt grep -E "(warning:|WARNING)" build-full.log >> errors.txt # 5. View errors file cat errors.txt # 6. Check log files created by script ls -lh /tmp/xcodebuild*.log ``` ## Quick Reference ```bash # Most common: View simulator build errors cat /tmp/xcodebuild_simulator.log | grep -E "(error:|warning:)" | head -30 # View full build log cat /tmp/xcodebuild_simulator.log | less # Search for specific error grep -i "cannot find type" /tmp/xcodebuild_simulator.log # Count errors by type grep "error:" /tmp/xcodebuild_simulator.log | cut -d: -f4 | sort | uniq -c | sort -rn ```