---
title: "ktm adb connect"
description: "Run `ktm adb connect` to open a local ADB tunnel to a remote phone, exposing it to Android Studio and your local ADB server."
sidebarTitle: "connect"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Open an ADB tunnel to a remote phone

## Usage

```bash
ktm adb connect [phone-serial] [flags]
```

## Examples

```bash
# 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

- [`ktm adb`](/cli/commands/adb)

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
