Android Debug Bridge (ADB) is a general-purpose command-line interface (CLI) tool in the Android system, which can be used to debug and manage applications on Android devices. This topic describes how to connect to cloud phones by using ADB.
Prerequisites
The cloud phone that you want to connect to is in the Running state.
An ADB key pair is bound to the cloud phone. For more information, see Import a key pair and Bind a key pair to an ECP instance.
An elastic IP address (EIP) is bound to the cloud phone. For more information, see Bind or unbind an EIP.
Procedure
Find the security group in which the cloud phone resides and open an idle port.
ImportantYou can specify any idle port. Make sure that the port is not occupied and the security group has allowed the port. Otherwise, you may fail to connect to the cloud phone.
In this example, port 5555 is used.
In the vSwitch/Security Group column, click the ID of the security group.
On the page to configure security group rules, add an inbound rule and open port 5555. For more information, see Add a security group rule.
Open CLI and run the following command to go to the directory in which ADB is stored:
In this example, Windows is used.
cd C:\Users\Administrator\Downloads\platform-tools
Run the following command to connect to the cloud phone by using ADB:
adb connect EIP of the cloud phone:Idle port
Sample command:
adb connect 116.62.XX.XX:5555
Run the following command to check whether the cloud phone is connected:
adb devices
If a message similar to the following command output is returned, the cloud phone is connected.
C:\Users\Administrator\Downloads\platform-tools>adb devices List of devices attached 116.62.XX.XXX:5555 device