@@ -50,36 +50,32 @@ jobs:
5050 echo "SIMULATOR_NAME=$SIMULATOR_NAME" >> $GITHUB_ENV
5151
5252 # List available simulators
53+ echo "=== Available iOS Simulators ==="
5354 xcrun simctl list devices available
5455
55- # Kill any existing simulators to start fresh
56- xcrun simctl shutdown all || true
57- sleep 5
58-
59- # Boot the specified simulator
60- echo "Booting $SIMULATOR_NAME..."
61- xcrun simctl boot "$SIMULATOR_NAME" || true
62-
63- # Wait for simulator to boot
64- echo "Waiting for simulator to boot..."
65- for i in {1..30}; do
66- if xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep -q "Booted"; then
67- echo "$SIMULATOR_NAME is booted!"
68- break
69- fi
70- echo "Waiting for $SIMULATOR_NAME boot... ($i/30)"
71- sleep 5
72- done
56+ # Check if iPhone 17 simulator is already booted
57+ if xcrun simctl list devices | grep "iPhone 17" | grep -q "Booted"; then
58+ echo "iPhone 17 simulator is already booted!"
59+ else
60+ # Boot the iPhone 17 simulator
61+ echo "Booting $SIMULATOR_NAME..."
62+ xcrun simctl boot "$SIMULATOR_NAME" || true
63+
64+ # Wait for simulator to boot
65+ echo "Waiting for simulator to boot..."
66+ for i in {1..30}; do
67+ if xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep -q "Booted"; then
68+ echo "$SIMULATOR_NAME is booted!"
69+ break
70+ fi
71+ echo "Waiting for $SIMULATOR_NAME boot... ($i/30)"
72+ sleep 5
73+ done
74+ fi
7375
7476 # Additional wait for simulator to be fully ready
7577 sleep 15
7678
77- # Install the app
78- #xcrun simctl install "$SIMULATOR_NAME" e2e-app/bitkit.app
79-
80- # Verify app installation
81- xcrun simctl listapps "$SIMULATOR_NAME" | grep -i bitkit || echo "App not found in simulator"
82-
8379 # Check simulator status
8480 xcrun simctl list devices | grep "$SIMULATOR_NAME"
8581
@@ -108,13 +104,31 @@ jobs:
108104 E2E : true
109105 run : |
110106 echo "=== Building iOS app ==="
111- xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
112- -scheme Bitkit \
113- -configuration Debug \
114- -destination 'platform=iOS Simulator,name=iPhone 17,OS=latest' \
115- -derivedDataPath DerivedData \
116- -allowProvisioningUpdates \
117- build
107+
108+ # Get the UDID of the booted simulator
109+ SIMULATOR_UDID=$(xcrun simctl list devices | grep "$SIMULATOR_NAME" | grep "Booted" | awk '{print $NF}' | tr -d '()')
110+ echo "Using simulator UDID: $SIMULATOR_UDID"
111+
112+ if [ -n "$SIMULATOR_UDID" ]; then
113+ # Build with specific simulator UDID
114+ xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
115+ -scheme Bitkit \
116+ -configuration Debug \
117+ -destination "platform=iOS Simulator,id=$SIMULATOR_UDID" \
118+ -derivedDataPath DerivedData \
119+ -allowProvisioningUpdates \
120+ build
121+ else
122+ # Fallback to generic iOS Simulator destination
123+ echo "No booted simulator found, trying generic destination..."
124+ xcodebuild -workspace Bitkit.xcodeproj/project.xcworkspace \
125+ -scheme Bitkit \
126+ -configuration Debug \
127+ -destination 'platform=iOS Simulator,name=iPhone 17' \
128+ -derivedDataPath DerivedData \
129+ -allowProvisioningUpdates \
130+ build
131+ fi
118132
119133 - name : Prepare app for E2E tests
120134 run : |
0 commit comments