@@ -105,31 +105,48 @@ jobs:
105105 run : |
106106 echo "=== Building iOS app ==="
107107
108- # Debug: Show the exact simulator line
109- echo "=== Debug: Simulator line ==="
110- xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep "Booted"
111- echo "=== End Debug ==="
108+ # Debug: Check available platforms and destinations
109+ echo "=== Available Platforms ==="
110+ xcodebuild -showsdks
111+ echo ""
112+ echo "=== Available Destinations ==="
113+ xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace -scheme Bitkit -showdestinations
114+ echo ""
112115
113- # Get the UDID of the booted simulator (extract the UUID from the parentheses)
114- SIMULATOR_UDID=$(xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep "Booted" | sed 's/.*(\([^)]*\)).*/\1/')
115- echo "Using simulator UDID: $SIMULATOR_UDID"
116+ # Check if iOS Simulator SDK is available
117+ echo "=== Checking iOS Simulator SDK ==="
118+ xcodebuild -showsdks | grep -i simulator || echo "No iOS Simulator SDK found"
119+ echo ""
116120
117- # Try alternative extraction method
118- if [ -z "$SIMULATOR_UDID" ] || [ "$SIMULATOR_UDID" = "Booted" ]; then
119- echo "Trying alternative UDID extraction..."
120- SIMULATOR_UDID=$(xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep "Booted" | awk -F'[()]' '{print $2}')
121- echo "Alternative UDID: $SIMULATOR_UDID"
122- fi
121+ # Try to install iOS Simulator if missing
122+ echo "=== Attempting to install iOS Simulator ==="
123+ xcodebuild -downloadPlatform iOS || echo "Failed to download iOS platform"
124+ echo ""
123125
124- # Try building with simulator name first (more reliable than UDID)
125- echo "Building with simulator name: $SIMULATOR_NAME"
126- xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
126+ # Try building for iOS Simulator with different approaches
127+ echo "=== Attempting iOS Simulator build ==="
128+
129+ # Try with just platform specification
130+ if xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
127131 -scheme Bitkit \
128132 -configuration Debug \
129- -destination "platform=iOS Simulator,name=$SIMULATOR_NAME " \
133+ -destination "platform=iOS Simulator" \
130134 -derivedDataPath DerivedData \
131135 -allowProvisioningUpdates \
132- build
136+ build; then
137+ echo "✅ iOS Simulator build succeeded!"
138+ else
139+ echo "❌ iOS Simulator build failed, trying with specific simulator..."
140+
141+ # Try with specific simulator name
142+ xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
143+ -scheme Bitkit \
144+ -configuration Debug \
145+ -destination "platform=iOS Simulator,name=$SIMULATOR_NAME" \
146+ -derivedDataPath DerivedData \
147+ -allowProvisioningUpdates \
148+ build
149+ fi
133150
134151 - name : Prepare app for E2E tests
135152 run : |
0 commit comments