From b45ac46b98563e5f8027b0bfa14543ff139b8074 Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Tue, 11 Nov 2025 19:47:12 -0800 Subject: [PATCH] fix(ios): correct simulator name extraction in build script Fixed simulator auto-detection to extract device name correctly: Simulator Detection: - Fixed sed command to extract device name (not UUID) - Pattern: extracts text before first parenthesis - Handles whitespace correctly with xargs Example: - Input: ' iPhone 17 Pro (UUID) (Status)' - Output: 'iPhone 17 Pro' Result: Build script now correctly detects and uses available iPhone simulators --- test-apps/ios-test-app/scripts/build-and-deploy.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test-apps/ios-test-app/scripts/build-and-deploy.sh b/test-apps/ios-test-app/scripts/build-and-deploy.sh index 2c4b729..bd2d5ae 100755 --- a/test-apps/ios-test-app/scripts/build-and-deploy.sh +++ b/test-apps/ios-test-app/scripts/build-and-deploy.sh @@ -80,10 +80,11 @@ log_info "Using CocoaPods: $POD_CMD" # Get simulator device (default to first available iPhone, or user-specified) if [ -z "$1" ]; then # Auto-detect first available iPhone simulator - SIMULATOR_DEVICE=$(xcrun simctl list devices available | grep -i "iPhone" | head -1 | sed 's/.*(\(.*\))/\1/' | xargs || echo "") + # Extract device name from: " iPhone 17 Pro (UUID) (Status)" + SIMULATOR_DEVICE=$(xcrun simctl list devices available | grep -i "iPhone" | head -1 | sed 's/^[[:space:]]*\([^(]*\).*/\1/' | xargs || echo "") if [ -z "$SIMULATOR_DEVICE" ]; then # Fallback to generic simulator - SIMULATOR_DEVICE="Any iOS Simulator Device" + SIMULATOR_DEVICE="generic/platform=iOS Simulator" log_warn "No iPhone simulators found, using generic destination" else log_info "Auto-detected simulator: $SIMULATOR_DEVICE"