Skip to content

Commit 25bfa2e

Browse files
committed
fix: use iOS 18 runtime for simulator tests (iOS 19 breaks WebKit Inspector)
iOS 19's WebKit Inspector Protocol has breaking changes — many domains (Runtime, DOM, CSS, CPUProfiler, Worker, etc.) return "domain was not found" when accessed through ios-webkit-debug-proxy. Use iOS 18 runtime on CI for full domain support. - CI: select Xcode 16 (iOS 18) if available on the runner - sim-setup.sh: prefer iOS 18 or lower runtimes over iOS 19+
1 parent dc06135 commit 25bfa2e

2 files changed

Lines changed: 33 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,25 @@ jobs:
8686
- name: Install ios-webkit-debug-proxy
8787
run: brew install ios-webkit-debug-proxy
8888

89+
- name: Select Xcode with iOS 18 runtime
90+
run: |
91+
# iOS 19+ has breaking WebKit Inspector Protocol changes (many
92+
# domains return "not found"). Use an older Xcode/iOS for testing.
93+
echo "Available Xcode versions:"
94+
ls -d /Applications/Xcode*.app 2>/dev/null || true
95+
echo ""
96+
# Prefer Xcode 16 (iOS 18) over Xcode 17 (iOS 19)
97+
for xcode in /Applications/Xcode_16*.app; do
98+
if [ -d "$xcode" ]; then
99+
echo "Selecting $xcode"
100+
sudo xcode-select -s "$xcode"
101+
break
102+
fi
103+
done
104+
echo "Active Xcode: $(xcode-select -p)"
105+
echo "Available runtimes:"
106+
xcrun simctl list runtimes
107+
89108
- name: Boot iOS Simulator and start iwdp
90109
run: |
91110
eval "$(./scripts/sim-setup.sh)"

scripts/sim-setup.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,27 @@ pkill -f ios_webkit_debug_proxy 2>/dev/null || true
3636
sleep 1
3737

3838
# 1. Find an available iPhone simulator.
39+
# Prefer iOS 18 or lower — iOS 19+ has breaking WebKit Inspector Protocol changes
40+
# where many domains (Runtime, DOM, etc.) return "domain was not found" through iwdp.
3941
DEVICE_NAME=$(xcrun simctl list devices available --json | \
4042
python3 -c "
41-
import json, sys
43+
import json, sys, re
4244
data = json.load(sys.stdin)
43-
for runtime, devs in sorted(data['devices'].items(), reverse=True):
45+
candidates = []
46+
for runtime, devs in data['devices'].items():
4447
if 'iOS' not in runtime and 'SimRuntime.iOS' not in runtime:
4548
continue
49+
m = re.search(r'iOS[- ](\d+)', runtime)
50+
ver = int(m.group(1)) if m else 0
4651
for d in devs:
4752
if 'iPhone' in d['name'] and d['isAvailable']:
48-
print(d['name'])
49-
sys.exit(0)
50-
print('', end='')
53+
candidates.append((ver, runtime, d['name']))
54+
if not candidates:
55+
print('', end='')
56+
sys.exit(0)
57+
# Sort: prefer iOS 18 and below (ver <= 18 first, descending), then 19+ as fallback
58+
candidates.sort(key=lambda x: (0 if x[0] <= 18 else 1, -x[0]))
59+
print(candidates[0][2])
5160
")
5261

5362
if [ -z "$DEVICE_NAME" ]; then

0 commit comments

Comments
 (0)