#!/bin/bash set -e SCHEME="WorkoutEditor" DEVICE="iPhone 17 Pro" BUNDLE_ID="com.metafluff.overrun" xcodebuild -scheme "$SCHEME" -destination "platform=iOS Simulator,name=$DEVICE" build 2>&1 | tail -5 APP_PATH=$(find ~/Library/Developer/Xcode/DerivedData/WorkoutEditor-*/Build/Products/Debug-iphonesimulator -name "WorkoutEditor.app" -maxdepth 1 | head -1) xcrun simctl install "$DEVICE" "$APP_PATH" xcrun simctl terminate "$DEVICE" "$BUNDLE_ID" 2>/dev/null || true xcrun simctl launch "$DEVICE" "$BUNDLE_ID"