chahinebrini 77407f9d63 feat(deploy): --skip-pods flag + quiet clean-ios
- clean-ios.sh: new --skip-pods (or SKIP_PODS=1) skips prebuild+pod install
  (use when Pods are already fresh — saves ~30s)
- clean-ios.sh: new --quiet (or REBREAK_QUIET=1) suppresses end-of-run
  'Nächste Schritte' tips (cluttered deploy output)
- deploy.sh: new --skip-pods flag, auto-passes --quiet to clean-ios.sh
2026-05-30 10:01:41 +02:00

103 lines
3.1 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: 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
#
# Env:
# SKIP_PODS=1 → überspringt prebuild + pod install (nutze wenn Pods frisch sind)
# REBREAK_QUIET=1 → unterdrückt die "Nächste Schritte"-Hinweise am Ende
set -e
cd "$(dirname "$0")"
MODE=""
for arg in "$@"; do
case "$arg" in
--skip-pods) SKIP_PODS=1 ;;
--quiet) REBREAK_QUIET=1 ;;
*) MODE="$arg" ;;
esac
done
SKIP_PODS="${SKIP_PODS:-0}"
REBREAK_QUIET="${REBREAK_QUIET:-0}"
# FamilyControls-Flag: default ON für lokale Dev-Builds (= entitlement aktiv).
# Override via `REBREAK_ENABLE_FAMILY_CONTROLS=0 ./clean-ios.sh ...`.
# Wird von plugins/with-rebreak-protection-ios.js + app.config.ts gelesen.
export REBREAK_ENABLE_FAMILY_CONTROLS="${REBREAK_ENABLE_FAMILY_CONTROLS:-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
if [ "$SKIP_PODS" = "1" ]; then
echo "⏭ SKIP_PODS=1 → prebuild + pod install übersprungen"
else
# 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)
fi
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"
;;
"")
# no follow-up — clean done.
;;
*)
echo "Unknown mode: $MODE"
echo "Usage: ./clean-ios.sh [--build|--xcode]"
exit 1
;;
esac