All Products
Search
Document Center

Cloud Phone:Manage key pairs

Last Updated:Jun 03, 2026

Prepare an ADB key pair and attach it to a Cloud Phone instance so that you can connect securely through ADB.

Prepare a key pair

You can create a key pair in the console or generate one locally with ADB and import it.

Create a key pair

  1. Log on to the Cloud Phone console.

  2. In the left-side navigation pane, choose Network & Security > Key.

  3. In the upper-left corner of the Secret page, click Create Key Pair.

  4. In the Create Key Pair dialog box, enter a name for the key pair and click OK.

    Note

    The name must be 2 to 128 characters long, cannot start with a special character or digit, and can only contain periods (.), underscores (_), hyphens (-), and colons (:).

    Important

    Your browser automatically downloads the adbkey file when you create a key pair. Save this file securely. Lost files cannot be recovered; you must create a new key pair.

Import a key pair

  1. Generate a key pair locally with ADB.

    Windows

    1. Download the ADB toolkit for Windows and extract the package.

    2. Open Command Prompt and navigate to the ADB toolkit directory.

      Note

      Replace the sample path with the actual directory path.

      cd C:\Users\Administrator\Downloads\platform-tools
    3. Generate a key pair.

      adb devices
      Note

      To regenerate a deleted key pair, run adb kill-server and then run adb devices.

      By default, ADB stores the key pair in the %USERPROFILE%\.android directory as two files: adbkey (private key) and adbkey.pub (public key).

    4. Open adbkey.pub and copy the public key.

    macOS

    1. Download the ADB toolkit for macOS and extract the package.

    2. Open Terminal and navigate to the ADB toolkit directory.

      Note

      Replace the sample path with the actual directory path.

      cd downloads/platform-tools
    3. Generate a key pair.

      ./adb devices
      Note

      To regenerate a deleted key pair, run ./adb kill-server and then run ./adb devices.

      By default, ADB stores the key pair in the ~/.android directory as two files: adbkey (private key) and adbkey.pub (public key).

    4. Open adbkey.pub and copy the public key.

    Linux

    1. Log on to your Linux server.

    2. Install the ADB toolkit.

      sudo apt-get install adb
    3. Verify the installation.

      adb version

      Expected output:

      [root@iZbp1dtvts0j8lbejlz**** ~]# adb version
      Android Debug Bridge version 1.0.39
    4. Generate a key pair.

      adb devices
      Note

      To regenerate a deleted key pair, run adb kill-server and then run adb devices.

      By default, ADB stores the key pair as two files, adbkey (private key) and adbkey.pub (public key), in the ~.android directory.

    5. View and copy the public key from adbkey.pub.

      cat ~/.android/adbkey.pub
  2. Import the public key into the console.

    1. Log on to the Cloud Phone console.

    2. In the left-side navigation pane, choose Network & Security > Key.

    3. In the upper-left corner of the Secret page, click Import Key Pair.

    4. In the Import Key Pair dialog box, enter a name for the key pair, paste the public key content that you copied in the previous step, and then click OK.

      Note

      The name must be 2 to 128 characters long, cannot start with a special character or digit, and can only contain periods (.), underscores (_), hyphens (-), and colons (:).

Attach a key pair

Prerequisites

The Cloud Phone instance must be in the Running state.

Procedure

  1. Log on to the Cloud Phone console.

  2. In the left-side navigation pane, choose Network & Security > Key.

  3. On the Secret page, find the target key pair and click Attach Key Pair in the Actions column.

  4. In the Attach Key Pair dialog box, select the target Cloud Phone instance from the Instances list on the left, click the arrow icon to move it to the list on the right, and then click Bind.

  5. Save the private key file adbkey to the correct local directory to enable ADB connections.

    • Windows: %USERPROFILE%\.android directory.

    • macOS: ~/.android directory.

    • Linux: ~.android directory.

    Restart the local ADB service.

    • Windows: adb kill-server

    • macOS: ./adb kill-server

    • Linux: adb kill-server

Unbind a key pair

Prerequisites

The Cloud Phone instance must be in the Running state.

Procedure

  1. Log on to the Cloud Phone console.

  2. In the left-side navigation pane, choose Network & Security > Key.

  3. On the Secret page, find the target key pair and click Unbind Key Pair in the Actions column.

  4. In the Unbind Key Pair dialog box, select the target Cloud Phone instance from the Instances list on the left, click the arrow icon to move it to the list on the right, and then click Disassociate.

  5. Note

    After unbinding a key pair, existing ADB sessions are not immediately disconnected, but new connection attempts will fail.

Delete a key pair

Prerequisites

The key pair must not be attached to any Cloud Phone instances.

Procedure

  1. Log on to the Cloud Phone console.

  2. In the left-side navigation pane, choose Network & Security > Key.

  3. On the Secret page, find the target key pair and click Delete in the Actions column.

  4. In the confirmation dialog box, click OK.

    Warning

    This action is irreversible; the key pair cannot be recovered once deleted. Proceed with caution.

Next steps

To connect to a Cloud Phone instance through ADB, follow the instructions in Connect to a Cloud Phone instance by using ADB.