---
title: "Enable ADB"
method: POST
path: "/sessions/{sid}/adb"
tags: ["ADB"]
---

# Enable ADB

`POST /sessions/{sid}/adb`

## Request

- Base URL: `https://api.phone-harness.com`
- URL: `https://api.phone-harness.com/sessions/{sid}/adb`
- Auth: HTTP bearer

Return the ADB endpoint and unlock code for one ready session owned by your account. Ready phones already have ADB enabled and carry the same values in the session's adb block, so this is only needed to re-enable after DELETE; it is idempotent. Takes no body. Watch tokens cannot enable access. See the [connection guide](/guides/connect-adb).

## Path parameters

- `sid` string, required

## Response `201`

Success.

- AdbConnection
  - `enabled` true, required
  - `transport` 'adb', required
  - `host` string, required: DNS name of the ADB endpoint. Use the returned value.
  - `port` integer, required: TCP port dedicated to this phone while the session lives. Run adb connect host:port.
  - `code` string, required: The unlock code. After connecting, run adb shell unlock <code>. Anyone who has host, port and code can drive the phone until the session ends or the code is reset.
  - `expires_at` number, required: Unix timestamp in seconds when access expires. Never later than the session deadline; ADB access does not extend the session.

## Other responses

- `400`: Invalid registration, or ADB is unavailable on the session provider. Unavailable ADB includes unsupported: true.
- `401`: Bad or missing bearer credential.
- `403`: Account access denied or rental access unavailable.
- `404`: No live session visible to the caller.
- `409`: Session is not ready, is closing, or the requested action conflicts with current state.
- `500`: Unexpected service error.

---

[API](https://skmtc.dev/phone-harness/apis/phone-harness-api.md) - [All operations](https://skmtc.dev/phone-harness/apis/phone-harness-api/llms.txt) - [OpenAPI document](https://skmtc.dev/phone-harness/apis/phone-harness-api/revisions/5af8941102e5?raw)
