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 eb9a5b1..764370c 100755 --- a/test-apps/ios-test-app/scripts/build-and-deploy.sh +++ b/test-apps/ios-test-app/scripts/build-and-deploy.sh @@ -89,8 +89,14 @@ if [ -z "$1" ]; then else # Extract device name (everything before the first parenthesis) SIMULATOR_DEVICE=$(echo "$SIMULATOR_LINE" | sed 's/^[[:space:]]*\([^(]*\).*/\1/' | xargs) - # Extract device ID (UUID in parentheses) - SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -1) + # Extract device ID (UUID in first set of parentheses, not status in second) + # Format: " iPhone 17 Pro (68D19D08-4701-422C-AF61-2E21ACA1DD4C) (Shutdown)" + # We want the UUID, which is in the first parentheses + SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | sed -n 's/.*(\([0-9A-F-]\{36\}\)).*/\1/p' | head -1) + if [ -z "$SIMULATOR_ID" ]; then + # Fallback: try to get first parentheses content (should be UUID) + SIMULATOR_ID=$(echo "$SIMULATOR_LINE" | sed -n 's/.*(\([^)]*\)).*/\1/p' | head -1) + fi log_info "Auto-detected simulator: $SIMULATOR_DEVICE (ID: $SIMULATOR_ID)" fi else