Updated on 2026-08-27 GMT+08:00

Generating a TAR Package for an Application and Pushing It to an OBS Bucket

Prerequisites

Example API

POST https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones/batch-storage
Header:
Content-Type: application/json
X-Auth-Token: ${token}
Body:
{
    "storage_infos": [{
        "phone_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "include_files": [
            "/data/app/${package_name}-*",
            "/data/data/${package_name}",
            "/data/media/0/Android/data/${package_name}"
        ],
        "bucket_name": "${bucket_name}",
        "object_path": "apk/${package_name}_${version_name}.tar"
    }]
}

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.
  • phone_id indicates the ID of the cloud phone on which the application is installed.
  • The three elements in include_files must be set to the absolute paths on the cloud phone.
  • If the installation package is an .xapk package, add /data/media/obb/${package_name} to include_files.
  • object_path indicates the path to which the .tar package is uploaded in the OBS bucket.
    1. In object_path, apk indicates an existing folder in the OBS bucket, ${package_name} indicates the package name of the current application, and ${version_name} indicates the version of the current application. The version number can be customized.
    2. Some shared applications download resource files online when they are started. You can start such applications before generating TAR packages to make them download resource files and patches. This way, shared applications do not need to download the files and patches again when they are installed and started on cloud phones.