> For the complete documentation index, see [llms.txt](https://docs.incogniton.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.incogniton.com/cloud-phones/connect-to-a-cloud-phone-with-adb.md).

# Connect to a cloud phone with ADB

Turn on ADB for a cloud phone in Cloud Phones → ⋮ → Enable ADB, copy the adb connect command and connect from a terminal on your computer.

Go to **Cloud Phones**, click the three-dot icon (⋮) next to the phone and click **Enable ADB**. When the phone is running, click the ⋮ icon again and click **Copy ADB command**, then paste the command in a terminal.

ADB (Android Debug Bridge) is Android's command-line tool for developers. With it you can install apps, run shell commands and connect Android automation tools to a cloud phone, just like a phone connected to your computer with a cable. You need the `adb` tool from Google's Android SDK Platform-Tools on your computer.

### Turn on ADB

{% stepper %}
{% step %}

#### Open the phone's menu

Click **Cloud Phones** in the left-side menu. Click the three-dot icon (⋮) next to the phone you want to connect to.
{% endstep %}

{% step %}

#### Enable ADB

Click **Enable ADB**. A message confirms "ADB successfully enabled".

**Enable ADB** is offered when the phone is powered on or powered off. It is not offered while the phone is still being set up, starting, resetting or switching its Android version.
{% endstep %}
{% endstepper %}

ADB stays on when you power the phone off and on again. To turn it off, open the ⋮ menu and click **Disable ADB**. This also closes the local ADB connection on your computer.

### Copy the ADB command

The phone must be **running** before you can connect. Power it on first if it is off.

There are two ways to copy the command:

* Click the ⋮ icon next to the phone and click **Copy ADB command**.
* Click the **ADB Address** column of the phone in the list. It shows **Copy** until a connection is open, and the local address after that.

Incogniton copies a command like `adb connect 127.0.0.1:6555` to your clipboard and shows a message that it was copied. **Copy ADB command** only appears when the phone is running and ADB is enabled.

### Connect from a terminal

Open a terminal (Command Prompt, PowerShell or Terminal), paste the command and press Enter:

```
adb connect 127.0.0.1:6555
```

After `adb` reports that it is connected, the cloud phone shows up in `adb devices` and you can use it like any other Android device, for example `adb shell` or `adb install app.apk`.

### How the connection works

You never connect to the cloud phone's own address. Incogniton opens a local port on your computer, `127.0.0.1:<port>` (a port between 6555 and 6654), and relays the connection securely to your phone. That is why the address always starts with `127.0.0.1`.

* The local port stays open as long as the phone is running with ADB enabled and Incogniton is open. When you power the phone off, disable ADB, reset the phone or log out, the port closes.
* The address only works on the computer where Incogniton is running. Other computers cannot use it.
* Connections from another user account on the same computer are refused. Only programs that run under your own computer account can use the port.
* Each time the phone starts, copy the command again: the port number can be different.

{% hint style="warning" %}
ADB gives full control over the phone. Only enable it when you need it, and disable it when you are done.
{% endhint %}

### Who can use ADB

In a team, turning ADB on or off and copying the ADB command need the **Manage cloud phones (edit, proxy, reset, Android version, ADB, root, apps, automation, move)** permission for that phone. See the [team permissions](https://docs.incogniton.com/cloud-phones/manage-cloud-phones.md#team-permissions) for cloud phones.

### When the connection doesn't work

* **"ADB access to … was refused. Check that the phone is on and ADB is enabled."** The phone is off, or ADB was turned off. Power the phone on, check that ADB is enabled and copy the command again.
* **"Could not open a local ADB port for …"** Incogniton couldn't open a local port for the phone. Try **Copy ADB command** again.
* **"Too many ADB connections are open. Close some and try again."** Disconnect devices you don't use any more with `adb disconnect`.
* **"The Incogniton ADB service cannot be reached. adb keeps retrying."** Your computer can't reach the ADB service right now. Check your internet connection; `adb` reconnects on its own.

You can also get the local address from a script: see [Control cloud phones from scripts and AI clients](https://docs.incogniton.com/cloud-phones/control-cloud-phones-from-scripts.md).

{% hint style="info" %}
If you have any questions about ADB on cloud phones, don't hesitate to contact our [support department](https://incogniton.com/contact/).
{% endhint %}
