Help Center> Cloud Phone Host> User Guide> Cloud Phone Management> Managing Cloud Phones in Batches
Updated on 2023-08-02 GMT+08:00

Managing Cloud Phones in Batches

By calling the ADB command API to push or install the Android package (APK) installation file stored in the Object Storage Service (OBS) bucket to cloud phones in batches, you can efficiently manage cloud phones in batches. This section describes how to install APKs on cloud phones to manage cloud phones in batches.

You can install and update the APK in either of the following ways:

  • Run the install command through the API. For details, see Installing the APK.
  • Grant the read permission to the installation package in the OBS bucket to the CPH built-in account, and install and update the APK by file push. For details, see Pushing Files.

Constraints and Limitations

CPH has the following restrictions on batch management risk and security:

  • The following control commands are supported:

    shell: Enable the remote interactive shell on the cloud phone.

    install: Install the software package on the cloud phone.

    uninstall: Remove the software package from the cloud phone.

    push: Copy a file or folder from the local device to the cloud phone.

  • Improper control commands and instructions will cause the cloud phone to malfunction and cannot be recovered.
  • To run the install or push command, strictly follow the instructions in Procedure, and build an APK data bucket inclusively used for batch cloud phone management to isolate the data from other data.
  • To run the install or push command, the file must be in .tar format. The files in the compressed package should include all the files required by AOSP.
  • On the same cloud phone server, the time consumed by file push is directly proportional to the number of files pushed.

Procedure

The following procedure demonstrates how to create a bucket for storing files and how to set permissions for the bucket. You can install and update APK only by invoking APIs.

  1. Log in to the management console.
  1. In the Service List, choose Storage > Object Storage Service.

    The Buckets page is displayed.

  2. In the upper right corner, click Create Bucket.
    Figure 1 Creating a bucket for batch management of cloud phones
    • Region: Select the region where the cloud phone server is located. The specified region cannot be changed after the bucket is created.
    • Default Storage Class: Select Standard.
    • Bucket Policy: Select Private.

    For details about other parameters, see Creating a Bucket.

  1. Click Create Now.

    Wait until the bucket is successfully created.

  2. Click the name of the created bucket, choose Objects in the navigation pane on the left, and click Create Folder.
    Figure 2 Objects
  3. Create a folder named file_{project_id}_01 and store files in the file_{project_id}_01 folder.
    {project_id} indicates the project ID in the region where the cloud phone server is located. For details about how to obtain the project ID, see How Do I Obtain the Project ID?
    Figure 3 Creating the file_{project_id}_01 folder
    • If there are a large number of cloud phones, you can create multiple folders, for example, file_{project_id}_01 and file_{project_id}_02, to improve the management efficiency.
    • Name the folder with a timestamp or function to ease package management, for example, file_{project_id}_01/20190506122012/xxxx.tar.
    • If you have hundreds of thousands of cloud phones, develop the application market based on OBS to install and upgrade the APK.
  1. In the navigation pane on the left, choose Permissions > Bucket Policy. On the displayed page, click Create.
    Figure 4 Creating a bucket policy
  2. Select Directory read and write to grant the read and write permissions of the specified directory in the OBS bucket to the CPH built-in account. Click Use Policy Template.
    Figure 5 Select Template
  3. For the Configure Policy step, configure the required parameters and click Next.
    • Principal: Select Other account.
    • Account ID: Enter the CPH built-in account.

      The CPH built-in account is mandatory and must contain the following information. You cannot enter the ID of your own account.

      Account ID: 529375c06c6340f299819082b3051225

      IAM User ID: 10208a4cf0944e339f523d9943ba02d3

    • User Policy: Select Include specified users.
      Figure 6 Configure Policy
  4. For resource, select Specified object in the current bucket and enter the resource name file_{project_id}_*, for example, file_0503ddaa18000ff21ff0c009e65d5482_*. Select Include specified resources for Resource Strategy and click Next.
    Figure 7 Specified objects
  5. Confirm the policy and click Create.
    Figure 8 Confirm Policy
  1. Click Objects. Place the .tar package to be installed in the file_{project_id}_01 folder. Call the ADB command API to test a cloud phone and check whether the authorization is successful.

    The following ADB command APIs are supported: