All Products
Search
Document Center

Cloud Phone:Connect to a Cloud Phone instance using ADB

Last Updated:Jun 02, 2026

Configure and connect to a Cloud Phone instance by using Android Debug Bridge (ADB).

Prerequisites

  1. Create or import a key pair in the Cloud Phone console and bind the key pair to the target Cloud Phone instance. For more information, see Manage key pairs.

  2. Save the private key file adbkey to the following directory to enable ADB logon.

    • Directory on macOS: ~/.android

    • Directory on Windows: %USERPROFILE%\.android

  3. Run the following commands to restart the local ADB service.

    adb kill-server
    adb start-server

Procedure

Note
  • If your Cloud Phone instance is in an instance group that uses a Shared Network, only an ADB connection over a VPC is supported.

  • If your Cloud Phone instance is in an instance group that uses a VPC, you can use one-click ADB (recommended), an ADB connection over a VPC, or an ADB connection over the Internet.

One-click ADB (recommended)

Prerequisites

Internet access must be enabled for the instance's VPC network. For more information, see Manage Internet access for a VPC network.

Procedure
  1. Log on to the Cloud Phone console.

  2. In the left-side navigation pane, choose Manage Resource > Instance.

  3. On the Instance page, find the target instance, click the ⋮ icon in the Actions column, and select One-click ADB.

  4. In the One-click ADB Connection panel, click Create ADB Connection.

    Note

    If the VPC network does not have Internet access enabled, click Activate Now in the dialog box that appears.

  5. After a moment, the ADB connection is automatically created. Click the copy icon next to ADB Connection Mode to copy the command.

What to do next

One-click ADB establishes the connection but does not configure security groups. Allow inbound TCP traffic on port 5555 from your source address to the Cloud Phone instance. For more information, see ADB connection over the Internet.

ADB connection over a VPC

  1. Connect to an Elastic Desktop Service (EDS) instance in the same VPC as your Cloud Phone instance.

  2. Run the following command to connect to the Cloud Phone instance.

    adb connect <192.168.XX.XX>:5555
    Note

    Replace <192.168.XX.XX> with the private IP address of the Cloud Phone.

    How to find the private IP address

    1. Log on to the Cloud Phone console.

    2. In the left-side navigation pane, choose Manage Resource > Instance.

    3. On the Instance page, find the target Cloud Phone instance and copy the value in the Private IP Address column.

ADB connection over the Internet

To connect to a Cloud Phone instance over the Internet by using ADB, create a DNAT entry and configure the security group.

  1. Create an Internet NAT gateway in the Cloud Phone instance's VPC. For more information, see Enable Internet access for a Cloud Phone instance. If an Internet NAT gateway already exists, skip this step.

  2. Create a DNAT entry on the Internet NAT gateway with a port mapping rule.

    1. Log on to the NAT gateway console.

    2. On the NAT Gateway page, find the target Internet NAT gateway instance, and click Configure DNAT in the Actions column.

    3. On the DNAT management tab, click Create DNAT entry.

    4. On the Create DNAT entry page, configure the following parameters:

      • Select EIP: Select an available elastic IP address (EIP). Note this EIP for use when connecting.

      • Select private IP address: Select Manual Input and enter the private IP address of the Cloud Phone instance.

        How to find the private IP address

        1. Log on to the Cloud Phone console.

        2. In the left-side navigation pane, choose Manage Resource > Instance.

        3. On the Instance page, find the target Cloud Phone instance and copy the value in the Private IP Address column.

      • Specific port: Enter the public and private ports to map, for example 1000:5555.

  3. Modify the policy security group rules to open port 5555 for public access.

    1. Log on to the ECS console.

    2. In the left-side navigation pane, choose Network & security > Elastic network interfaces.

    3. On the Elastic network card page, click the ID of the target elastic network interface. Then, in the Basic Information section, click the ID of the first security group.

      Note

      The elastic network interface has two security groups: vda and policy. Modify the policy group. Click a security group ID to view its name.

    4. On the security group details page, click the Inbound tab, click Add rule, and configure the following settings:

      • Action: Allow

      • Priority: 1

      • Protocol type: Custom TCP

      • Port range: 5555/5555

      • Source: 0.0.0.0/0

        Note

        This allows all IP addresses to access port 5555. For better security, specify the public IP address of your local device.

  4. Run the following command to connect to the Cloud Phone instance:

    adb connect <Public IP>:<DNAT public port>
    Note

    Replace <PublicIPAddress> with the EIP of the DNAT entry and <DNATPublicPort> with the public port. In this example, the port is 1000.

FAQ

NAT gateway connection failure

  1. Verify the command format:

    adb connect <Public IP>:<DNAT public port>
  2. If the command is correct, verify the following:

    • A DNAT entry exists for the Internet NAT gateway.

    • The public IP address and port are correct.

    • The security group rules allow traffic on the specified port.

    • The VPC route table is correctly configured, the route's next hop is the Internet NAT gateway, and the gateway has an SNAT entry.

ADB authentication failure

  1. Verify that a key pair is bound to the instance and that you have downloaded the corresponding adbkey file to the correct directory on your local computer.

  2. After binding the key pair to the instance and saving the private key to the correct directory, restart the ADB service:

    adb kill-server
    adb start-server