local-adb-bridge
v1.2.5
Published
Local WebSocket relay so browsers can pull The Tower saves via host ADB
Maintainers
Readme
local-adb-bridge
Tiny localhost HTTP + WebSocket relay so the published Tower Run Tracker website can pull playerInfo.dat through your machine’s adb binary (emulators cannot use in-browser TCP on normal websites).
Usage
# From this repo (uses the latest sources):
npx local-adb-bridge
# From npm (pin the version — older releases may lack Mac/Linux native paths or USB fixes):
npx [email protected]On first run the bridge will:
- Look for
adbon your PATH and in common Android SDK / WinGet / Homebrew locations. - If
adbexists but is not on PATH, add its folder to your current session and user PATH. - If
adbis missing, install Android Platform Tools automatically:- Windows:
winget(Google.PlatformTools), then Google zip download if needed - macOS: Homebrew
android-platform-tools, then zip fallback - Linux:
apt(may prompt forsudo), then zip fallback
- Windows:
Leave the terminal open while importing from the tracker website.
Windows USB (phone) and Autoplay
USB import uses host adb in this terminal — not WebUSB in the browser. On Windows, Autoplay can briefly switch the phone to MTP and disconnect adb; bridge 1.2.5+ waits for the USB stack to settle (default 0.8s before/after pull on Windows)
macOS, Linux, and native installs
On Connect Emulator, the bridge tries adb first (BlueStacks, MuMu, Waydroid, USB phones, etc.). If nothing is connected, it also checks common on-disk save locations:
- macOS: App Store / native app under
~/Library/Containers/com.TechTreeGames.TheTower/… - Linux: Waydroid and Anbox paths under your home directory
- Windows: WSA / app package storage when present
Connect via USB always uses adb on the phone — not the Mac/Linux desktop install. and shows a progress bar in this window.
If you still see connect/disconnect loops:
- Windows → Autoplay settings → your phone → Take no action
- Optional:
LOCAL_ADB_BRIDGE_USB_SETTLE_MS=2000for a longer quiet period - Phone USB mode: File transfer (not “Charge only”), USB debugging allowed
Published site (HTTPS) and browser permission
When you use the live tracker site (not the Vite dev server), Chrome or Edge must allow local / private network access so the page can reach http://127.0.0.1:43781 and the WebSocket on the same port.
- Run
npx local-adb-bridgeon the same PC as the emulator. - On the import page, click Connect Emulator.
- When the browser shows a permission prompt, click Allow.
- If no prompt appears: site settings → Permissions → Local network access → Allow for this site.
The bridge answers GET /private-network-ping with CORS + Access-Control-Allow-Private-Network: true so the browser can complete the Private Network Access preflight before opening the WebSocket.
Environment variables
LOCAL_ADB_BRIDGE_PORT— default43781ADB_PATHorLOCAL_ADB_BRIDGE_ADB— full path toadb/adb.exe(skips auto-discovery)LOCAL_ADB_BRIDGE_SKIP_AUTO_INSTALL=1— do not install or modify PATH; fail ifadbis missing
Bundled zip installs are stored under ~/.local-adb-bridge/platform-tools/.
