Files
m3te/.vscode/ios-sim-debug.sh
swipelab 6f7d2f4db2 lang migration: rename signed integer types sN -> iN
Mechanical sweep of all .sx sources, plan docs, and tests/expected
snapshots for the sx language rename (s8/s16/s32/s64 -> i8/i16/i32/i64).
Verified: tools/run_tests.sh 23/23.

Note: the ios-sim build has 2 pre-existing 'restart' dot-call errors
from the sx opt-in UFCS change (sx a47ea14) — independent of this
rename (present pre-sweep); migrated in the follow-up commit.
2026-06-12 09:36:51 +03:00

30 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
# preLaunchTask for "Debug SxChess (iOS sim)": build SxChess for the iOS
# simulator with debug info, install it to a single simulator, and launch it
# PAUSED for a debugger (--wait-for-debugger). The launch.json `custom` config
# then `target create`s the local binary (so the .dSYM resolves breakpoints)
# and `process attach -n SxChess`es the waiting process.
set -e
SX="/Users/agra/projects/sx/zig-out/bin/sx"
DSYMUTIL="/opt/homebrew/opt/llvm@19/bin/dsymutil"
# Reuse ONE simulator (sx-test-ios18). Swap the UDID for a different device.
SIM="E8DF755C-997D-49D7-9DB0-CFA48F8254CD"
APP="sx-out/ios/M3te.app"
BUNDLE="co.swipelab.m3te"
# Debug build: -O0 + DWARF (--emit-obj keeps the object), then a portable .dSYM.
"$SX" build --target ios-sim --emit-obj main.sx
"$DSYMUTIL" "$APP/M3te"
# Boot the sim (idempotent) and surface the Simulator UI.
xcrun simctl boot "$SIM" 2>/dev/null || true
xcrun simctl bootstatus "$SIM" >/dev/null 2>&1 || true
open -a Simulator
xcrun simctl install "$SIM" "$APP"
xcrun simctl terminate "$SIM" "$BUNDLE" >/dev/null 2>&1 || true
# Launch paused; the app waits at its entry until lldb attaches and continues.
xcrun simctl launch --wait-for-debugger "$SIM" "$BUNDLE"