Skip to content

Commit fb4869e

Browse files
committed
Fix simctl runtime parser for Xcode 26 output format
1 parent 1051245 commit fb4869e

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/ios-ci.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,29 @@ jobs:
5858
5959
RUNTIME_ID=$(
6060
xcrun simctl list runtimes available \
61-
| sed -n 's/.*(\(com\.apple\.CoreSimulator\.SimRuntime\.iOS-[^)]*\)).*/\1/p' \
61+
| sed -nE 's/.*- (com\.apple\.CoreSimulator\.SimRuntime\.iOS-[[:alnum:]-]+).*/\1/p' \
6262
| tail -n 1
6363
)
6464
65+
if [[ -z "${RUNTIME_ID:-}" ]]; then
66+
# Fallback for alternate simctl output formats.
67+
RUNTIME_ID=$(
68+
xcrun simctl list runtimes available \
69+
| sed -nE 's/.*\((com\.apple\.CoreSimulator\.SimRuntime\.iOS-[^)]*)\).*/\1/p' \
70+
| tail -n 1
71+
)
72+
fi
73+
6574
DEVICE_TYPE_ID=$(
6675
xcrun simctl list devicetypes \
67-
| sed -n 's/.*iPhone 16.*(\(com\.apple\.CoreSimulator\.SimDeviceType\.[^)]*\)).*/\1/p' \
68-
| head -n 1
76+
| sed -nE 's/.*iPhone 16.*\((com\.apple\.CoreSimulator\.SimDeviceType\.[^)]*)\).*/\1/p' \
77+
| tail -n 1
6978
)
7079
7180
if [[ -z "${DEVICE_TYPE_ID:-}" ]]; then
7281
DEVICE_TYPE_ID=$(
7382
xcrun simctl list devicetypes \
74-
| sed -n 's/.*iPhone.*(\(com\.apple\.CoreSimulator\.SimDeviceType\.[^)]*\)).*/\1/p' \
83+
| sed -nE 's/.*iPhone.*\((com\.apple\.CoreSimulator\.SimDeviceType\.[^)]*)\).*/\1/p' \
7584
| head -n 1
7685
)
7786
fi

0 commit comments

Comments
 (0)