ktm adb connect
Run ktm adb connect to open a local ADB tunnel to a remote phone, exposing it to Android Studio and your local ADB server.
Open an ADB tunnel to a remote phone
Usage
ktm adb connect [phone-serial] [flags]
Examples
# Pick a phone interactively (busy phones show their holder)
ktm adb connect
# Connect to a specific phone (auto-registers with local ADB server)
ktm adb connect EXAMPLE1234
# Custom local port
ktm adb connect EXAMPLE1234 --port 7037
# Find a free phone first
ktm adb status
Arguments
| Argument | Required |
|---|---|
phone-serial | No |
Flags
| Flag | Type | Default | Description |
|---|---|---|---|
--port | int | 6037 | Local port to listen on |
Details
Starts an ADB tunnel to a phone hosted on a remote agent.
With no argument on an interactive terminal, you pick a phone from the list of available devices. In scripts (or with a serial argument) it connects directly.
The phone is exposed on a local port and registered with your local ADB server automatically, so Android Studio picks it up like a locally plugged device. Port forwarding, reverse forwarding, and JDWP all work — your real local ADB server handles all protocol concerns.
You hold the phone exclusively while connected. It is released the moment you disconnect (Ctrl+C); if the session is interrupted uncleanly, it auto-releases after a few minutes.
The agent's ADB bridge must be on: if it is off, connect offers to enable it (interactive terminals) or exits with the 'ktm adb enable' command to run. The picker shows each phone's agent, bridge state and holder, so a free phone is visible without a separate lookup; 'ktm adb status' shows the same table.
Related
Global flags (--output, --debug, --host, …) apply to every command. See the command reference overview.
What's next?
Last updated on