File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 4444 cd ios && pod install
4545 working-directory : ${{ inputs.working_directory }}
4646 shell : bash
47- - name : Start iOS simulator (background)
47+ - name : Setup iOS Simulator
4848 run : |
49- xcrun simctl boot "iPhone 15" &
49+ # Check if iPhone 15 device exists
50+ if ! xcrun simctl list devices | grep -q "iPhone 15"; then
51+ echo "iPhone 15 device not found, creating one..."
52+
53+ # Get the latest available iOS runtime
54+ RUNTIME=$(xcrun simctl list runtimes | grep iOS | tail -1 | awk '{print $NF}')
55+ echo "Using runtime: $RUNTIME"
56+
57+ # Create iPhone 15 device with available runtime
58+ xcrun simctl create "iPhone 15" "com.apple.CoreSimulator.SimDeviceType.iPhone-15" "$RUNTIME" || \
59+ xcrun simctl create "iPhone 15" "iPhone 15" "$RUNTIME" || \
60+ echo "Could not create iPhone 15, will use available device"
61+ fi
62+
63+ # Boot iPhone 15 if it exists, otherwise use first available iPhone
64+ if xcrun simctl list devices | grep -q "iPhone 15"; then
65+ xcrun simctl boot "iPhone 15" &
66+ else
67+ DEVICE=$(xcrun simctl list devices available | grep "iPhone" | head -1 | sed 's/.*\(iPhone[^(]*\).*/\1/' | xargs)
68+ echo "Using fallback device: $DEVICE"
69+ xcrun simctl boot "$DEVICE" &
70+ fi
5071 shell : bash
5172 - name : Start Metro Packager (background)
5273 run : |
You can’t perform that action at this time.
0 commit comments