Help Center> Cloud Phone Host> Best Practices> Best Practices of Connecting to Gaming Phones> Deploying Games> Generating the TAR Package of the Application and Pushing It to the OBS Bucket

Generating the TAR Package of the Application and Pushing It to the 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}-1",
            "/data/app/${package_name}-2",
            "/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 four elements of include_files are four fixed paths.
  • If the installation package is a .xapk package, add /data/media/obb/${package_name} to include_files.
  • object_path indicates the path to which the .tar package is uploaded.

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

  • package_name and version_name indicate the package name and version number of the current application.