84 lines
2.5 KiB
Bash
Executable File
84 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
||
# Rebreak Native: Nuclear iOS Clean + Rebuild
|
||
#
|
||
# Wann brauchst du das?
|
||
# - Build-Errors die nach Native-Code-Änderung aus dem Nichts kommen
|
||
# - "fmt consteval", "Hermes", "RCT-Folly" Compile-Errors in Pods
|
||
# - Stale DerivedData-Cache nach Xcode-Upgrade
|
||
# - Nach App-Bundle-ID/Entitlement-Änderungen
|
||
# - Nach Hinzufügen/Entfernen von Native Modules oder Config-Plugins
|
||
#
|
||
# Was es NICHT zerstört:
|
||
# - Code in app/, components/, modules/, plugins/ (alles was in git getrackt ist)
|
||
# - node_modules
|
||
#
|
||
# Was es zerstört:
|
||
# - ios/Pods, ios/Podfile.lock, ios/build (vollständig regeneriert via prebuild)
|
||
# - DerivedData-Cache von Xcode (wird beim nächsten Build neu aufgebaut)
|
||
#
|
||
# Modi:
|
||
# ./clean-ios.sh → clean + prebuild + pod install (kein Build)
|
||
# ./clean-ios.sh --build → + zusätzlich pnpm ios am Ende (wirft App auf Sim/Device)
|
||
# ./clean-ios.sh --xcode → + zum Schluss Xcode-Workspace öffnen
|
||
|
||
set -e
|
||
cd "$(dirname "$0")"
|
||
|
||
MODE="${1:-}"
|
||
|
||
echo "🧹 Rebreak Native iOS Clean"
|
||
echo "==========================="
|
||
echo ""
|
||
|
||
# 1. Wipe Pods, Lockfile, Build-Output
|
||
echo "→ rm -rf ios/Pods ios/Podfile.lock ios/build"
|
||
rm -rf ios/Pods ios/Podfile.lock ios/build
|
||
|
||
# 2. Wipe Xcode DerivedData (nur für Rebreak — nicht das ganze ~/Library)
|
||
DERIVED_DATA="$HOME/Library/Developer/Xcode/DerivedData"
|
||
if [ -d "$DERIVED_DATA" ]; then
|
||
echo "→ rm -rf $DERIVED_DATA/Rebreak-*"
|
||
rm -rf "$DERIVED_DATA"/Rebreak-* 2>/dev/null || true
|
||
fi
|
||
|
||
# 3. Prebuild: regeneriert ios/ aus app.config.ts + Config-Plugins
|
||
# Dank with-fmt-consteval-fix-Plugin wird das Podfile auto-gepatcht.
|
||
echo "→ pnpm expo prebuild --clean"
|
||
pnpm expo prebuild --clean
|
||
|
||
# 4. Pod install
|
||
echo "→ cd ios && pod install"
|
||
(cd ios && pod install)
|
||
|
||
echo ""
|
||
echo "✅ Clean done."
|
||
echo ""
|
||
|
||
case "$MODE" in
|
||
--build|build)
|
||
echo "🔨 Building + running on connected device/simulator..."
|
||
pnpm ios
|
||
;;
|
||
|
||
--xcode|xcode)
|
||
echo "🔨 Opening Xcode-Workspace..."
|
||
osascript -e 'tell application "Xcode" to close every window whose name contains "Rebreak.xcodeproj"' 2>/dev/null || true
|
||
open -a Xcode ios/Rebreak.xcworkspace
|
||
echo ""
|
||
echo "ℹ️ In Xcode: Cmd+R für Build & Run"
|
||
;;
|
||
|
||
"")
|
||
echo "ℹ️ Nächste Schritte:"
|
||
echo " ./dev-ios.sh # Xcode öffnen (manueller Build)"
|
||
echo " pnpm ios # CLI-Build auf Sim/Device"
|
||
echo " ./clean-ios.sh --build # alles in einem Rutsch"
|
||
;;
|
||
|
||
*)
|
||
echo "Unknown mode: $MODE"
|
||
echo "Usage: ./clean-ios.sh [--build|--xcode]"
|
||
exit 1
|
||
;;
|
||
esac
|