Skip to content

Commit 25269c4

Browse files
authored
Use Xcode 26 and iOS 26 simulator in iOS CI (#4455)
CI now verifies against xcode 26 in preparation for server upgrades. This is the first stage of work for #4456
1 parent 610830c commit 25269c4

3 files changed

Lines changed: 39 additions & 10 deletions

File tree

.github/workflows/scripts-ios.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ jobs:
130130
- name: Run iOS UI screenshot tests
131131
env:
132132
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
133-
IOS_SIM_DESTINATION: platform=iOS Simulator,name=iPhone 16 Pro,OS=18.5
134133
run: |
135134
set -euo pipefail
136135
mkdir -p "${ARTIFACTS_DIR}"
@@ -152,4 +151,3 @@ jobs:
152151
path: artifacts
153152
if-no-files-found: warn
154153
retention-days: 14
155-

scripts/build-ios-app.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ set -euo pipefail
55
bia_log() { echo "[build-ios-app] $1"; }
66

77
# Pin Xcode so CN1’s Java subprocess sees xcodebuild
8-
export DEVELOPER_DIR="/Applications/Xcode_16.4.app/Contents/Developer"
8+
XCODE_APP="${XCODE_APP:-/Applications/Xcode_26.0.1.app}"
9+
if [ ! -d "$XCODE_APP" ]; then
10+
bia_log "Xcode 26 not found at $XCODE_APP. Set XCODE_APP to the Xcode 26 app bundle path." >&2
11+
exit 1
12+
fi
13+
export DEVELOPER_DIR="$XCODE_APP/Contents/Developer"
914
export PATH="$DEVELOPER_DIR/usr/bin:$PATH"
1015

1116
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -161,4 +166,4 @@ ARTIFACTS_DIR="${ARTIFACTS_DIR:-$REPO_ROOT/artifacts}"
161166
mkdir -p "$ARTIFACTS_DIR"
162167
xcodebuild -workspace "$WORKSPACE" -list > "$ARTIFACTS_DIR/xcodebuild-list.txt" 2>&1 || true
163168

164-
exit 0
169+
exit 0

scripts/run-ios-ui-tests.sh

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ ri_log "Loading workspace environment from $ENV_FILE"
5454
source "$ENV_FILE"
5555

5656
# Use the same Xcode as the build step
57-
export DEVELOPER_DIR="/Applications/Xcode_16.4.app/Contents/Developer"
57+
XCODE_APP="${XCODE_APP:-/Applications/Xcode_26.0.1.app}"
58+
if [ ! -d "$XCODE_APP" ]; then
59+
ri_log "Xcode 26 not found at $XCODE_APP. Set XCODE_APP to the Xcode 26 app bundle path." >&2
60+
exit 3
61+
fi
62+
export DEVELOPER_DIR="$XCODE_APP/Contents/Developer"
5863
export PATH="$DEVELOPER_DIR/usr/bin:$PATH"
5964

6065
if [ -z "${JAVA17_HOME:-}" ] || [ ! -x "$JAVA17_HOME/bin/java" ]; then
@@ -475,6 +480,28 @@ APP_PROCESS_NAME="${WRAPPER_NAME%.app}"
475480
LOG_STREAM_PID=$!
476481
sleep 2
477482

483+
LAUNCH_LOG="$ARTIFACTS_DIR/simctl-launch.log"
484+
485+
launch_simulator_app() {
486+
local target="$1"
487+
local attempt=1
488+
while true; do
489+
local output
490+
if output="$(xcrun simctl launch "$target" "$BUNDLE_IDENTIFIER" 2>&1)"; then
491+
printf '%s\n' "$output" >> "$LAUNCH_LOG"
492+
return 0
493+
fi
494+
printf '%s\n' "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] simctl launch failed (attempt $attempt): $output" >> "$LAUNCH_LOG"
495+
if [ "$attempt" -ge 2 ]; then
496+
return 1
497+
fi
498+
ri_log "simctl launch failed (attempt $attempt), retrying"
499+
xcrun simctl bootstatus "$target" -b >/dev/null 2>&1 || true
500+
sleep 5
501+
attempt=$((attempt + 1))
502+
done
503+
}
504+
478505
ri_log "Installing simulator app bundle"
479506
INSTALL_START=$(date +%s)
480507
if [ -n "$SIM_DEVICE_ID" ]; then
@@ -485,8 +512,8 @@ APP_PROCESS_NAME="${WRAPPER_NAME%.app}"
485512
INSTALL_END=$(date +%s)
486513

487514
LAUNCH_START=$(date +%s)
488-
if ! xcrun simctl launch "$SIM_DEVICE_ID" "$BUNDLE_IDENTIFIER" >/dev/null 2>&1; then
489-
ri_log "FATAL: simctl launch failed"
515+
if ! launch_simulator_app "$SIM_DEVICE_ID"; then
516+
ri_log "FATAL: simctl launch failed (see $LAUNCH_LOG)"
490517
exit 11
491518
fi
492519
LAUNCH_END=$(date +%s)
@@ -498,8 +525,8 @@ APP_PROCESS_NAME="${WRAPPER_NAME%.app}"
498525
INSTALL_END=$(date +%s)
499526

500527
LAUNCH_START=$(date +%s)
501-
if ! xcrun simctl launch booted "$BUNDLE_IDENTIFIER" >/dev/null 2>&1; then
502-
ri_log "FATAL: simctl launch failed"
528+
if ! launch_simulator_app booted; then
529+
ri_log "FATAL: simctl launch failed (see $LAUNCH_LOG)"
503530
exit 11
504531
fi
505532
LAUNCH_END=$(date +%s)
@@ -659,4 +686,3 @@ cp -f "$BUILD_LOG" "$ARTIFACTS_DIR/xcodebuild-build.log" 2>/dev/null || true
659686
cp -f "$TEST_LOG" "$ARTIFACTS_DIR/device-runner.log" 2>/dev/null || true
660687

661688
exit $comment_rc
662-

0 commit comments

Comments
 (0)