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
This commit is contained in:
Matthew Raymer
2025-11-11 19:47:12 -08:00
parent a6b48013ab
commit b45ac46b98

View File

@@ -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"