From 07927bee7d49bf714948a73b66c0040facdf3171 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:35:26 +0000 Subject: [PATCH 1/4] Initial plan From fbc721abe824a2f8a9c58973f7117e1a639b1959 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:39:28 +0000 Subject: [PATCH 2/4] Add explicit simulator boot step to ensure iOS tests run consistently Co-authored-by: jaredmixpanel <10504508+jaredmixpanel@users.noreply.github.com> --- .github/workflows/node.js.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index e0ceaa0d..0d0cc14c 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -88,6 +88,18 @@ jobs: - name: Setup iOS working-directory: ./Samples/SimpleMixpanel/ios run: pod install --repo-update + - name: List available simulators + run: xcrun simctl list devices available + - name: Boot iOS Simulator + run: | + SIMULATOR_ID=$(xcrun simctl list devices available | grep -m 1 'iPhone' | grep -oE '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}') + if [ -z "$SIMULATOR_ID" ]; then + echo "No iPhone simulator found" + exit 1 + fi + echo "Booting simulator: $SIMULATOR_ID" + xcrun simctl boot "$SIMULATOR_ID" || true + xcrun simctl list devices | grep Booted - name: Test iOS working-directory: ./Samples/SimpleMixpanel run: react-native run-ios From c3888c5c3a1d1e21ff6135b780df2ec036175be5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:40:49 +0000 Subject: [PATCH 3/4] Improve simulator boot logic with JSON parsing and proper error handling Co-authored-by: jaredmixpanel <10504508+jaredmixpanel@users.noreply.github.com> --- .github/workflows/node.js.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 0d0cc14c..19c93848 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -92,13 +92,21 @@ jobs: run: xcrun simctl list devices available - name: Boot iOS Simulator run: | - SIMULATOR_ID=$(xcrun simctl list devices available | grep -m 1 'iPhone' | grep -oE '[0-9A-F]{8}-([0-9A-F]{4}-){3}[0-9A-F]{12}') + # Get list of available iPhone simulators + SIMULATOR_ID=$(xcrun simctl list devices available -j | jq -r '.devices | to_entries[] | .value[] | select(.name | contains("iPhone")) | .udid' | head -n 1) if [ -z "$SIMULATOR_ID" ]; then - echo "No iPhone simulator found" + echo "Error: No iPhone simulator found" exit 1 fi - echo "Booting simulator: $SIMULATOR_ID" - xcrun simctl boot "$SIMULATOR_ID" || true + echo "Found simulator: $SIMULATOR_ID" + # Check if simulator is already booted + if xcrun simctl list devices | grep -q "$SIMULATOR_ID.*Booted"; then + echo "Simulator already booted" + else + echo "Booting simulator..." + xcrun simctl boot "$SIMULATOR_ID" + fi + # Verify simulator is booted xcrun simctl list devices | grep Booted - name: Test iOS working-directory: ./Samples/SimpleMixpanel From 5125ac039b309414d0a17eb6e566958882256d06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Oct 2025 17:42:36 +0000 Subject: [PATCH 4/4] Optimize simulator boot script with better comments and reduced redundant calls Co-authored-by: jaredmixpanel <10504508+jaredmixpanel@users.noreply.github.com> --- .github/workflows/node.js.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 19c93848..be37e1d8 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -93,6 +93,7 @@ jobs: - name: Boot iOS Simulator run: | # Get list of available iPhone simulators + # Note: jq is pre-installed on macOS GitHub Actions runners SIMULATOR_ID=$(xcrun simctl list devices available -j | jq -r '.devices | to_entries[] | .value[] | select(.name | contains("iPhone")) | .udid' | head -n 1) if [ -z "$SIMULATOR_ID" ]; then echo "Error: No iPhone simulator found" @@ -100,13 +101,15 @@ jobs: fi echo "Found simulator: $SIMULATOR_ID" # Check if simulator is already booted - if xcrun simctl list devices | grep -q "$SIMULATOR_ID.*Booted"; then + DEVICE_LIST=$(xcrun simctl list devices) + if echo "$DEVICE_LIST" | grep -q "$SIMULATOR_ID.*Booted"; then echo "Simulator already booted" else echo "Booting simulator..." xcrun simctl boot "$SIMULATOR_ID" fi # Verify simulator is booted + echo "Booted simulators:" xcrun simctl list devices | grep Booted - name: Test iOS working-directory: ./Samples/SimpleMixpanel