Skip to content

Run a virtual iPhone on an Apple Silicon Mac.

Swift

fix vphone_jb_setup.sh script.

Gilbo6b6f3b15043c
diff --git a/scripts/vphone_jb_setup.sh b/scripts/vphone_jb_setup.sh
index 915077a9..d7fa980a 100755
--- a/scripts/vphone_jb_setup.sh
+++ b/scripts/vphone_jb_setup.sh
@@ -13,25 +13,8 @@ set -uo pipefail
LOG="/var/log/vphone_jb_setup.log"
DONE_MARKER="/var/mobile/.vphone_jb_setup_done"
-log() { echo "[$(date '+%H:%M:%S')] $*" | tee -a "$LOG"; }
-die() { log "FATAL: $*"; exit 1; }
-
-# Redirect all output to log
-exec > >(tee -a "$LOG") 2>&1
-
-log "=== vphone_jb_setup.sh starting ==="
-
-# ── Check done marker ────────────────────────────────────────
-if [ -f "$DONE_MARKER" ]; then
- log "Already completed (marker exists), exiting."
- exit 0
-fi
-
-# ── Environment ──────────────────────────────────────────────
export TERM=xterm-256color
export DEBIAN_FRONTEND=noninteractive
-
-# Discover PATH dynamically
P=""
for d in \
/var/jb/usr/bin /var/jb/bin /var/jb/sbin /var/jb/usr/sbin \
@@ -40,8 +23,24 @@ for d in \
[ -d "$d" ] && P="$P:$d"
done
export PATH="${P#:}"
+
+# Redirect all output (stdout+stderr) through tee to the log + console.
+exec > >(tee -a "$LOG") 2>&1
+
+# NOTE: log() does NOT pipe through tee — stdout is already tee'd to $LOG by the
+# exec above, so a second tee here would double every timestamped line.
+log() { echo "[$(date '+%H:%M:%S')] $*"; }
+die() { log "FATAL: $*"; exit 1; }
+
+log "=== vphone_jb_setup.sh starting ==="
log "PATH=$PATH"
+# ── Check done marker ────────────────────────────────────────
+if [ -f "$DONE_MARKER" ]; then
+ log "Already completed (marker exists), exiting."
+ exit 0
+fi
+
# ── Find boot manifest hash ─────────────────────────────────
BOOT_HASH=""
for d in /private/preboot/*/; do