This topic describes how to create an Android Debug Bridge (ADB) key pair and bind it to a cloud phone instance. Once these steps are complete, you can securely connect to the phone by using the ADB toolkit.
Prepare an ADB key pair
You can create an ADB key pair directly in the Cloud Phone console. Alternatively, you can generate an ADB key pair on your on-premises devices by using the ADB toolkit and then import it into the Cloud Phone console.
Create an ADB key pair
Log on to the Cloud Phone console.
In the left-side navigation pane, choose .
In the upper-left corner of the Key page, click Create Key Pair.
In the Create Key Pair dialog box, enter a key pair name and click Create.
NoteA key pair name must be between 2 and 128 characters long and cannot begin with a special character or digit. It can only include periods (.), underscores (_), hyphens (-), and colons (:).
ImportantAfter you create the key pair, the browser will automatically download the adbkey file. Make sure to save this file securely. If the file is lost, the key pair will need to be recreated.
Import an ADB key pair
You can generate an ADB key pair on your on-premises devices by using the ADB toolkit.
Windows
Download the ADB toolkit for Windows and extract the contents of the package.
Open the CLI and run the following command to navigate to the directory where the ADB toolkit is stored:
NoteUpdate the command by replacing the directory path with the one you are using.
cd C:\Users\Administrator\Downloads\platform-toolsRun the following command to generate a key pair:
adb devicesNoteIf you've deleted the key pair from the download directory and need to regenerate it, first run
adb kill-serverand then runadb devices.By default, the ADB-generated key pair is stored in the
%USERPROFILE%\.androiddirectory, consisting of two files: adbkey (the private key) and adbkey.pub (the public key).Open the adbkey.pub file and copy its public key content.
macOS
Download the ADB toolkit for macOS and extract the contents of the package.
Open the CLI and run the following command to navigate to the directory where the ADB toolkit is stored:
NoteUpdate the command by replacing the directory path with the one you are using.
cd downloads/platform-toolsRun the following command to generate a key pair:
./adb devicesNoteIf you've deleted the key pair from the download directory and need to regenerate it, first run
./adb kill-serverand then run./adb devices.By default, the ADB-generated key pair is stored in the
~/.androiddirectory, consisting of two files: adbkey (the private key) and adbkey.pub (the public key).Open the adbkey.pub file and copy its public key content.
Linux
Remotely log on to your Linux server.
Run the following command to install the ADB toolkit:
sudo apt-get install adbRun the following command to check whether the ADB toolkit is installed:
adb versionA command output like the one below indicates that the ADB toolkit is installed:
[root@iZbp1dtvts0j8lbejlz**** ~]# adb version Android Debug Bridge version 1.0.39Run the following command to generate a key pair:
adb devicesNoteIf you've deleted the key pair from the download directory and need to regenerate it, first run
adb kill-serverand then runadb devices.By default, the ADB-generated key pair is stored in the
~.androiddirectory, consisting of two files: adbkey (the private key) and adbkey.pub (the public key).Run the following command to open the adbkey.pub file and copy its public key content:
cat ~.android/adbkey.pub
Import the ADB key pair.
Log on to the Cloud Phone console.
In the left-side navigation pane, choose .
In the upper-left corner of the Key page, click Import Key Pair.
In the Import Key Pair dialog box, enter a key pair name, paste the public key that you copied in the previous step, and then click OK.
NoteA key pair name must be between 2 and 128 characters long and cannot begin with a special character or digit. It can only include periods (.), underscores (_), hyphens (-), and colons (:).
Bind an ADB key pair
Prerequisites
The cloud phone to which you want to bind an ADB key pair is in the Available state.
Procedure
Log on to the Cloud Phone console.
In the left-side navigation pane, choose .
On the Key page, find the ADB key pair that you want to bind and click Attach Key Pair in the Actions column.
In the Attach Key Pair dialog box, select a cloud phone instance from the Instances section on the left, click icon to the right of the instance, and then click Bind.

Once you bind the key pair to the cloud phone instance, save the adbkey (the private key) file in the appropriate directory based on your operating system. (This will enable ADB-based access from your on-premises device to the cloud phone instance.)
Windows:
%USERPROFILE%\.android.macOS:
~/.android.Linux:
~.android.
To restart the ADB process in the on-premises environment, run the following command based on your operating system:
Windows:
adb kill-servermacOS:
./adb kill-serverLinux:
adb kill-server
Unbind an ADB key pair
Prerequisites
The cloud phone from which you want to unbind an ADB key pair is in the Available state.
Procedure
Log on to the Cloud Phone console.
In the left-side navigation pane, choose .
On the Key page, find the ADB key pair that you want to unbind and click Unbind Key Pair in the Actions column.
In the Unbind Key Pair dialog box, select the target cloud phone instance from the Instances section on the left, click icon to the right of the instance, and then click Disassociate.
After you unbind the key pair from the cloud phone instance, the current ADB-based session will not end immediately. However, any attempts to establish a new ADB-based session will fail due to authentication issues.
Delete an ADB key pair
Prerequisites
The key pair you want to delete has been removed from all cloud phone instances.
Procedure
Log on to the Cloud Phone console.
In the left-side navigation pane, choose .
On the Key page, find the ADB key pair that you want to delete and click Delete in the Actions column.
In the message that appears, click OK.
WarningOnce the key pair is deleted, it cannot be restored. Proceed with caution when performing this action.