Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 0 additions & 2 deletions .github/workflows/scripts-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ jobs:
- name: Run iOS UI screenshot tests
env:
ARTIFACTS_DIR: ${{ github.workspace }}/artifacts
IOS_SIM_DESTINATION: platform=iOS Simulator,name=iPhone 16 Pro,OS=18.5
run: |
set -euo pipefail
mkdir -p "${ARTIFACTS_DIR}"
Expand All @@ -152,4 +151,3 @@ jobs:
path: artifacts
if-no-files-found: warn
retention-days: 14

9 changes: 7 additions & 2 deletions scripts/build-ios-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ set -euo pipefail
bia_log() { echo "[build-ios-app] $1"; }

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

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

exit 0
exit 0
38 changes: 32 additions & 6 deletions scripts/run-ios-ui-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ ri_log "Loading workspace environment from $ENV_FILE"
source "$ENV_FILE"

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

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

LAUNCH_LOG="$ARTIFACTS_DIR/simctl-launch.log"

launch_simulator_app() {
local target="$1"
local attempt=1
while true; do
local output
if output="$(xcrun simctl launch "$target" "$BUNDLE_IDENTIFIER" 2>&1)"; then
printf '%s\n' "$output" >> "$LAUNCH_LOG"
return 0
fi
printf '%s\n' "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] simctl launch failed (attempt $attempt): $output" >> "$LAUNCH_LOG"
if [ "$attempt" -ge 2 ]; then
return 1
fi
ri_log "simctl launch failed (attempt $attempt), retrying"
xcrun simctl bootstatus "$target" -b >/dev/null 2>&1 || true
sleep 5
attempt=$((attempt + 1))
done
}

ri_log "Installing simulator app bundle"
INSTALL_START=$(date +%s)
if [ -n "$SIM_DEVICE_ID" ]; then
Expand All @@ -485,8 +512,8 @@ APP_PROCESS_NAME="${WRAPPER_NAME%.app}"
INSTALL_END=$(date +%s)

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

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

exit $comment_rc

Loading