68 lines
2.5 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Rebreak Native: Dev-Server (Metro) + iOS Build & Run
# Pendant zu apps/rebreak/dev-ios.sh, aber für React Native + Expo statt Capacitor.
set -e
cd "$(dirname "$0")"
echo "🧠 Rebreak Native iOS Dev"
echo "========================="
# Modi:
# ./dev-ios.sh → öffnet Xcode-Workspace (Default — User baut auf iPhone)
# ./dev-ios.sh --device → physisches iPhone via USB (CLI-Build + Auto-Launch)
# ./dev-ios.sh --simulator → iOS Simulator (schnellster Test-Loop, weniger Auth/Push-Test)
MODE="${1:-xcode}"
# Metro-Port wird NICHT mehr automatisch gekillt — falls du Metro in einem
# anderen Terminal laufen hast, würde das hier die Session zerstören.
# Falls Metro hängt: manuell `lsof -ti:8081 | xargs kill -9` ausführen.
# Cocoapods: läuft beim ersten Run automatisch via expo run:ios.
# Falls "objectVersion 70 not supported" Fehler unter Xcode 26 → CocoaPods updaten:
# sudo gem install cocoapods --pre
#
# Podfile-Fixes werden durch Config-Plugins automatisch reinpatcht:
# - plugins/with-fmt-consteval-fix.js → FMT_USE_CONSTEVAL=0 (Xcode 16 + RN 0.79)
# - plugins/with-rebreak-protection-ios.js → NEFilter Extension Target
# → expo prebuild --clean ist daher SAFE (Plugins regenerieren die Patches).
#
# Für radikalen Cache-Reset: ./clean-ios.sh
# Bei Build-Errors aus dem Nichts: ./clean-ios.sh --build
# 3. Run je nach Mode
case "$MODE" in
--xcode|xcode|"")
# Falls Xcode bereits mit Rebreak.xcodeproj (statt .xcworkspace) offen ist,
# schließe ihn erst. Sonst kriegst du zwei Project-Windows.
osascript -e 'tell application "Xcode" to close every window whose name contains "Rebreak.xcodeproj"' 2>/dev/null || true
echo "🔨 Opening Xcode-Workspace..."
open -a Xcode ios/Rebreak.xcworkspace
echo ""
echo "✅ Xcode offen — In Xcode:"
echo " 1. iPhone via USB anschließen (falls nicht schon)"
echo " 2. Top-Bar: iPhone als Run-Target wählen (links neben Play-Button)"
echo " 3. Cmd+R für Build & Run auf iPhone"
echo ""
echo " Metro: separat starten via 'pnpm expo start --dev-client' falls noch nicht läuft"
;;
--device|device)
echo "📱 Building für physisches iPhone (USB)..."
echo " Erste Mal: Xcode wird geöffnet zum Signing-Setup."
pnpm expo run:ios --device
;;
--simulator|simulator)
echo "📱 Building für iOS Simulator..."
pnpm expo run:ios
;;
*)
echo "Unknown mode: $MODE"
echo "Usage: ./dev-ios.sh [--xcode|--device|--simulator]"
exit 1
;;
esac