Configuration

June 19, 2026 · View on GitHub

Config lives in ~/.hermes/.env (only needed for direct USB/LAN; relay mode is the default and needs none).

VariableDefaultPurpose
ANDROID_BRIDGE_URLhttp://localhost:8766Relay URL, or direct phone URL for USB/LAN
ANDROID_BRIDGE_TOKEN(none)Pairing code for auth headers
ANDROID_RELAY_PORT8766Port the relay listens on
ANDROID_RELAY_HOSTlocalhostRelay bind address (see #38)
ANDROID_BRIDGE_TIMEOUT30HTTP request timeout (seconds)

Connection modes

  • Relay (default): phone connects out to ws://server:8766/ws. No .env config needed; android_setup configures it.
  • Same WiFi (direct): ANDROID_BRIDGE_URL=http://192.168.x.x:8765.
  • USB (direct): adb forward tcp:8765 tcp:8765 then ANDROID_BRIDGE_URL=http://localhost:8765.

Ports

  • 8765 — phone's Ktor HTTP server (direct dev).
  • 8766 — relay (WebSocket + HTTP bridge).

Never echo or dump these env values — ANDROID_BRIDGE_TOKEN is the pairing code. See SECURITY.md.