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

Deploying Applications

Servers of Storage 2.0 (Recommended)

Push the .tar package to servers. That is, push apk/${package_name}_${version_name}.tar to the shared application of ${server_id1} and ${server_id2}.

  • Example API
    POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/share-apps
    Header: 
    Content-Type: application/json 
    X-Auth-Token: ${token} 
    Body: 
    {
          "package_name": "${package_name}"
        "bucket_name": "${bucket_name}",
        "object_path": "apk/${package_name}_${version_name}.tar",
        "server_ids": [
            "${server_id1}",
            "${server_id2}"
        ]
    }

    Parameter descriptions:

    • Obtain the values of parameters such as CPH Endpoint, project_id, ${token}, bucket_name, and object_path by referring to Installing Applications on a Cloud Phone.
    • package_name indicates the package name of the application in Android, for example, com.miniteck.miniworld.
    • object_path indicates the path to which the .tar package is uploaded.
    • package_name and version_name indicate the package name and version number of the current application.

    apk is any existing folder. In ${package_name}_${version_name}.tar, package_name and version_name need to be modified as required.

    • server_ids indicates IDs of servers where the application is to be deployed. You can enter multiple server IDs. To obtain the server IDs, call the API for Querying Cloud Phone Servers.
  • Example

    For details, see Pushing a Shared Application in the Cloud Phone Host API Reference.

Servers of Storage 1.0

Push the .tar package to the server. That is, push apk/${package_name}_${version_name}.tar to the shared storage of ${server_id1} and ${server_id2}.

  • Example API
    POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/share-files
    Header: 
    Content-Type: application/json 
    X-Auth-Token: ${token} 
    Body: 
    {
        "bucket_name": "${bucket_name}",
        "object_path": "apk/${package_name}_${version_name}.tar",
        "server_ids": [
            "${server_id1}",
            "${server_id2}"
        ]
    }

    Parameter descriptions:

    • Obtain the values of parameters such as CPH Endpoint, project_id, ${token}, bucket_name, and object_path by referring to Installing Applications on a Cloud Phone.
    • object_path indicates the path to which the .tar package is uploaded.
    • package_name and version_name indicate the package name and version number of the current application.

      apk is any existing folder. In ${package_name}_${version_name}.tar, package_name and version_name need to be modified as required.

    • server_ids indicates the ID list of servers where the application is deployed. You can enter multiple server IDs. To obtain the server IDs, you can call the API for Querying Cloud Phone Servers.
  • Example

    For details, see Pushing Shared Storage Files in the Cloud Phone Host API Reference.

  • Follow-up procedure

    Reset all cloud phones in batches by referring to Resetting Cloud Phones in the Cloud Phone Host API Reference.