#!/usr/bin/env bash # Dev launcher for the Alarm client. # # Expects metro already running on 127.0.0.1:8089 (start it with `bun start` # in another terminal). Reverses the adb tunnels so the device reaches the # dev machine via 127.0.0.1, then builds, installs and launches the app: # - 8080 the instance/Maestro origin (dev default; every service path lives # under it — the client never opens the service's own 8088) # - 8089 the Metro packager (this client's port) # Each reverse maps device 127.0.0.1: -> host 127.0.0.1:. # # The instance address is the one thing the app configures (Settings). Leave it # at the default http://127.0.0.1:8080 for a USB phone with these reverses, or # point it at a LAN/WAN origin; there is no direct-service mode to toggle. set -euo pipefail for port in 8080 8089; do adb reverse tcp:"$port" tcp:"$port" >/dev/null 2>&1 || true done if ! curl -sf http://127.0.0.1:8089/status >/dev/null 2>&1; then echo "WARNING: metro is not running on :8089. Start it first with: bun start" fi exec bunx react-native run-android --port 8089 --no-packager