Skip to content

Commit f1f0914

Browse files
committed
Improve iOS E2E test robustness
- Add fallback for iOS runtime detection (iOS 17/18 or latest available) - Add debugging output for simulator and app detection - Make app installation path detection more flexible - Add error handling for simulator creation
1 parent f559421 commit f1f0914

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

.circleci/config.yml

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,15 +194,31 @@ jobs:
194194
- run:
195195
name: Create and boot iPhone 15 simulator
196196
command: |
197-
RUNTIME=$(xcrun simctl list runtimes | grep "iOS 18" | tail -1 | awk '{print $NF}' | sed 's/[()]//g')
197+
# List available runtimes and find the latest iOS runtime
198+
xcrun simctl list runtimes
199+
RUNTIME=$(xcrun simctl list runtimes | grep "iOS" | grep -E "(18\.|17\.)" | tail -1 | awk '{print $NF}' | sed 's/[()]//g')
200+
if [ -z "$RUNTIME" ]; then
201+
echo "No iOS 17/18 runtime found, using default iOS runtime"
202+
RUNTIME=$(xcrun simctl list runtimes | grep "iOS" | tail -1 | awk '{print $NF}' | sed 's/[()]//g')
203+
fi
198204
echo "Creating iPhone 15 simulator with runtime $RUNTIME"
199-
xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 $RUNTIME
205+
xcrun simctl create "iPhone 15" com.apple.CoreSimulator.SimDeviceType.iPhone-15 $RUNTIME || true
200206
xcrun simctl boot "iPhone 15" || true
201207
202208
- run:
203209
name: Install app on simulator
204210
command: |
205-
xcrun simctl install booted ~/project/example/test/build/Build/Products/Release-iphonesimulator/IntercomReactNativeExampleUI.app
211+
# List available simulators
212+
xcrun simctl list devices
213+
# Find the built app
214+
find ~/project/example/test/build -name "*.app" -type d
215+
APP_PATH=$(find ~/project/example/test/build -name "IntercomReactNativeExampleUI.app" -type d | head -1)
216+
if [ -z "$APP_PATH" ]; then
217+
echo "App not found, trying alternative path"
218+
APP_PATH=$(find ~/project/example/test/build -name "*.app" -type d | head -1)
219+
fi
220+
echo "Installing app from: $APP_PATH"
221+
xcrun simctl install booted "$APP_PATH"
206222
207223
- run:
208224
working_directory: example/test

0 commit comments

Comments
 (0)