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
- The required Android Package (APK) has been stored in the Object Storage Service (OBS) bucket in the region where the cloud phone server is deployed. For details about how to upload the installation package, see Scenario 2: Uploading and Downloading Files Through OBS Browser+.
- The OBS bucket policies have been configured based on Delegating CPH to Operate OBS Buckets.
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot