All Products
Search
Document Center

Cloud Phone:AttachKeyPair

Last Updated:Dec 12, 2025

Attaches an Android Debug Bridge (ADB) key pair to one or more cloud phone instances.

Operation description

  • You can attach to an ADB key pair only to cloud phone instances in the Running state.

  • After you attach an ADB key pair, make sure the private key of the ADB key pair is copied to the ~/.android directory (macOS or Linux operating systems) or the C:\Users\Username.android directory (Windows operating systems). In addition, you must run the adb kill-server command to restart the ADB process to ensure correct ADB connection. Otherwise, ADB connection may fail due to authentication exceptions.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

KeyPairId

string

Yes

The ID of the ADB key pair.

kp-6v2q33ae4tw3a****

InstanceIds

array

No

The IDs of the cloud phone instances. You can specify a maximum of 50 cloud phone instances.

string

No

The ID of the cloud phone instance.

acp-5hh4a31emkt6u****

Response elements

Element

Type

Description

Example

object

The response parameters.

Data

object

The object that is returned.

KeyPairId

string

The ID of the ADB key pair.

kp-6v2q33ae4tw3a****

TotalCount

integer

The total number of the cloud phone instances.

100

FailCount

integer

The number of the cloud phone instances to which the ADB key pair failed to be attached.

0

AttachedInstanceIds

array

The IDs of the cloud phone instances to which the ADB key pair is successfully attached.

string

The ID of the cloud phone instance.

acp-5hh431emkt6ua****

RequestId

string

The ID of the request.

69BCBBE4-FCF2-59B8-AD9D-531EB422****

Examples

Success response

JSON format

{
  "Data": {
    "KeyPairId": "kp-6v2q33ae4tw3a****",
    "TotalCount": 100,
    "FailCount": 0,
    "AttachedInstanceIds": [
      "acp-5hh431emkt6ua****"
    ]
  },
  "RequestId": "69BCBBE4-FCF2-59B8-AD9D-531EB422****"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.