#!/bin/bash # Local build test script # Run from the project root: ./scripts/test-ios-build.sh /path/to/your/profile.mobileprovision set -e PROFILE_PATH="$1" if [ -z "$PROFILE_PATH" ]; then echo "Usage: $0 /path/to/profile.mobileprovision" exit 1 fi if [ ! -f "$PROFILE_PATH" ]; then echo "Error: Profile not found at $PROFILE_PATH" exit 1 fi echo "=== Extracting profile info ===" UUID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract UUID raw -) PROFILE_NAME=$(security cms -D -i "$PROFILE_PATH" | plutil -extract Name raw -) BUNDLE_ID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract Entitlements.application-identifier raw - 2>/dev/null | sed 's/.*\.//') TEAM_ID=$(security cms -D -i "$PROFILE_PATH" | plutil -extract TeamIdentifier.0 raw -) echo "Profile Name: $PROFILE_NAME" echo "UUID: $UUID" echo "Bundle ID: $BUNDLE_ID" echo "Team ID: $TEAM_ID" echo "" echo "=== Installing provisioning profile ===" mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles cp "$PROFILE_PATH" ~/Library/MobileDevice/Provisioning\ Profiles/$UUID.mobileprovision echo "Installed to: ~/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision" echo "" echo "=== Listing signing identities ===" security find-identity -v -p codesigning echo "" echo "=== Navigating to iOS project ===" cd ios/LibNovel echo "" echo "=== Generating Xcode project ===" xcodegen generate --spec project.yml --project . echo "" echo "=== Testing fastlane build ===" export USER=runner export BUILD_NUMBER=999 export PROVISIONING_PROFILE_NAME="$PROFILE_NAME" # Run fastlane beta lane fastlane beta --verbose echo "" echo "=== Build succeeded! ==="