commit 0e884f18dc9658f7a246d6e2171e22000c58f6ce
parent f1425934d86438534c62db902d319be1f39ed1c6
Author: Michael Camilleri <[email protected]>
Date: Thu, 19 Mar 2026 14:15:35 +0900
Update iOS UI test script to accept a version number
Diffstat:
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/Scripts/test-ios-ui.sh b/Scripts/test-ios-ui.sh
@@ -1,8 +1,32 @@
#!/bin/bash
set -euo pipefail
+MAJOR="${1:-18}"
+RUNTIME=$(xcrun simctl list runtimes available \
+ | grep "iOS ${MAJOR}\." \
+ | sed 's/.*iOS \([0-9.]*\).*/\1/' \
+ | sort -t. -k1,1n -k2,2n \
+ | tail -1)
+
+if [ -z "$RUNTIME" ]; then
+ echo "No available iOS ${MAJOR}.x simulator runtime found." >&2
+ exit 1
+fi
+
+DEVICE=$(xcrun simctl list devices available "iOS ${RUNTIME}" \
+ | grep "iPhone" \
+ | head -1 \
+ | sed 's/^ *\(.*\) ([A-F0-9-]*).*/\1/')
+
+if [ -z "$DEVICE" ]; then
+ echo "No available iPhone simulator found for iOS ${RUNTIME}." >&2
+ exit 1
+fi
+
+echo "Using ${DEVICE}, iOS ${RUNTIME}"
+
xcodebuild test \
-scheme "Listless iOS" \
- -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.6' \
+ -destination "platform=iOS Simulator,name=${DEVICE},OS=${RUNTIME}" \
-only-testing:"Listless iOS UI Tests" \
2>&1