Updated on 2023-12-25 GMT+08:00

Installing Applications on a Cloud Phone

Install applications on a cloud phone by referring to Installing the APK in the Cloud Phone Host API Reference.

Prerequisites

Example API

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/commands
Header:
Content-Type: application/json
X-Auth-Token: ${token}
Body:
{
    "command": "install",
    "content": "-t -r obs://{bucket_name}/{object_path}",
    "phone_ids": [
        "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    ]
}

Parameter descriptions:

  • Obtain the values of parameters such as CPH Endpoint, project_id, and ${token} by referring to Querying Cloud Phones.
  • bucket_name indicates the OBS bucket name. object_path indicates the path for storing the application installation package.
  • phone_ids indicates the ID of the cloud phone on which the application is to be installed. (Obtain the cloud phone ID by referring to Querying Cloud Phones. You can enter multiple cloud phone IDs, and the application will be installed on all these cloud phones.)

API Calling Example

POST https://cph.cn-east-3.myhuaweicloud.com/v1/081ceeb7fb800f0c2f4cc004bb39c2f7/cloud-phone/phones/commands 
Content-Type: application/json
X-Auth-Token: ${token}
{ 
    "command": "install", 
    "content": "-t -r obs://yzw-apk-install/apk/com.hermes.bgame.apk", 
    "phone_ids": [ 
        "bdc2f2e960164dd9a2765374afeea300" 
    ] 
}
  • yzw-apk-install is the OBS bucket name.

    apk/com.hermes.bgame.apk is the path of the application installation package.

    obs://yzw-apk-install/apk/com.hermes.bgame.apk is the full path of the application installation package.

  • Replace ${token} with the actual token.