Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/actions/tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -230,18 +230,21 @@ runs:
# Ensure Xcode Command Line Tools are available (rarely needed on macos-14)
xcode-select --install || true

# Try to find an available iPhone SE simulator
SIMULATOR_UDID=$(xcrun simctl list devices available | grep "iPhone SE" | sort -rV | head -n 1 | awk -F '[()]' '{print $2}')
# List devices for debug purposes
xcrun simctl list devices

# Try to find an available iPhone 15 Pro simulator
SIMULATOR_UDID=$(xcrun simctl list devices available | grep "iPhone 15 Pro" | grep -Eo '[A-F0-9-]{36}' | head -n 1)

if [ -z "$SIMULATOR_UDID" ]; then
echo "No available iPhone SE simulator found. Creating one..."
echo "No available iPhone 15 Pro simulator found. Creating one..."

# Get latest iOS runtime available
RUNTIME=$(xcrun simctl list runtimes | grep iOS | grep -v unavailable | sort -rV | head -n 1 | awk -F '[()]' '{print $2}')
echo "Using runtime: $RUNTIME"

# Create a new iPhone SE (3rd generation) simulator
SIMULATOR_UDID=$(xcrun simctl create "iPhone SE (3rd generation) - CI" "iPhone SE (3rd generation)" "$RUNTIME")
# Create a new iPhone 15 Pro simulator
SIMULATOR_UDID=$(xcrun simctl create "iPhone 15 Pro - CI" "iPhone 15 Pro" "$RUNTIME")
echo "Created new simulator: $SIMULATOR_UDID"
else
echo "Found available simulator: $SIMULATOR_UDID"
Expand Down