All Products
Search
Document Center

Cloud Phone:Best practices for file and app distribution

Last Updated:Aug 11, 2025

You can use the SendFile API to upload files from Object Storage Service (OSS) to a specified folder on a Cloud Phone instance. You can also use a public download link to upload an application package to a specified folder on multiple Cloud Phone instances and automatically install the application. This topic describes four typical scenarios that demonstrate how to use this API to distribute files and applications.

Prerequisites

  • General prerequisites for all scenarios:

    • All target Cloud Phone instances are in the same region.

    • The status of all target Cloud Phone instances is Active.

  • Specific prerequisites for Scenario 4 (Internet download and internal distribution):

    • The first Cloud Phone instance to which you want to send the file has Internet access permissions.

    • The first Cloud Phone instance has sufficient storage space for the file or application to be distributed.

    • You have activated Object Storage Service (OSS). In this scenario, only the first Cloud Phone instance downloads the file or application from the Internet. The instance then uploads the file or application to an OSS bucket that you own in the same region.

      Important

      OSS storage incurs additional costs. For more information, see Billing overview.

Scenario 1: Upload a regular file

Scenario

You need to upload the file snapshot.png from an OSS bucket in the China (Hangzhou) region to the /sdcard/Pictures folder on the Cloud Phone instances acp-c8rzmx8fnwba6**** and acp-5fc8mx8fnw9s5**** in the same region.

SendFile API call example

  • Request message

    {
        "AndroidInstanceIdList": [
            "acp-c8rzmx8fnwba6****",
            "acp-5fc8mx8fnw9s5****"
        ],
        "SourceFilePath": "/sdcard/Pictures",
        "UploadType": "OSS",
        "UploadUrl": "oss://cloudphone-saved-bucket-cn-hangzhou-****/picture/snapshot.png",
        "UploadEndpoint": "oss-cn-hangzhou-internal.aliyuncs.com"
    }
  • Response message

    {
      "TaskId": "t-gk0ahswe4blor****",
      "RequestId": "5D6FB544-F20E-14F8-B627-3F32C337****",
      "Data": [
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-c8rzmx8fnwba6****"
        },
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-5fc8mx8fnw9s5****"
        }
      ]
    }

Scenario 2: Upload and automatically install an application package

Scenario

You have an application package named SogouInput_12.15.0_android_sweb.apk in an OSS bucket in the China (Hangzhou) region. You need to perform the following tasks:

  1. Upload the package to the /sdcard/Download folder on the Cloud Phone instances acp-c8rzmx8fnwba6**** and acp-5fc8mx8fnw9s5**** in the China (Hangzhou) region.

  2. Rename it to sougou.apk.

  3. Automatically install the application after the upload completes.

SendFile API call example

  • Request message

    {
        "AndroidInstanceIdList": [
            "acp-c8rzmx8fnwba6****",
            "acp-5fc8mx8fnw9s5****"
        ],
        "SourceFilePath": "/sdcard/Download",
        "UploadType": "OSS",
        "UploadUrl": "oss://cloudphone-saved-bucket-cn-hangzhou-****/app/SogouInput_12.15.0_android_sweb.apk",
        "UploadEndpoint": "oss-cn-hangzhou-internal.aliyuncs.com",
        "TargetFileName": "sougou.apk",
        "AutoInstall": "true"
    }
  • Response message

    {
      "TaskId": "t-gk0ahswe4blor****",
      "RequestId": "5D6FB544-F20E-14F8-B627-3F32C337****",
      "Data": [
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-c8rzmx8fnwba6****"
        },
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-5fc8mx8fnw9s5****"
        }
      ]
    }

Scenario 3: Download and automatically install an application package from the Internet (individual download mode)

Scenario

You have a download link for an application package: https://apkdl.example.com/wapdl/android/apk/SogouInput_12.15.0_android_sweb.apk. You need to perform the following tasks:

  1. The Cloud Phone instances acp-c8rzmx8fnwba6**** and acp-5fc8mx8fnw9s5**** in the China (Hangzhou) region individually download the package from the Internet, save it to the /sdcard/Download folder, and rename it to sougou.apk.

  2. Automatically install the application after the download completes.

SendFile API call example

  • Request message

    {
        "AndroidInstanceIdList": [
            "acp-c8rzmx8fnwba6****",
            "acp-5fc8mx8fnw9s5****"
        ],
        "SourceFilePath": "/sdcard/Download/sougou.apk",
        "UploadType": "DOWNLOAD_URL",
        "UploadUrl": "https://apkdl.example.com/wapdl/android/apk/SogouInput_12.15.0_android_sweb.apk",
        "AutoInstall": "true"
    }
  • Response message

    {
      "TaskId": "t-gk0ahswe4blor****",
      "RequestId": "5D6FB544-F20E-14F8-B627-3F32C337****",
      "Data": [
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-c8rzmx8fnwba6****"
        },
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-5fc8mx8fnw9s5****"
        }
      ]
    }

Scenario 4: Download and automatically install an application package from the Internet (Internet download and internal distribution mode)

Scenario

You have a download link for an application package: https://apkdl.example.com/wapdl/android/apk/SogouInput_12.15.0_android_sweb.apk. You need to perform the following tasks:

  1. Cloud Phone instance 1, acp-c8rzmx8fnwba6****, in the China (Hangzhou) region, which has Internet access, downloads the package from the Internet. It then saves the package to the /sdcard/Download folder, renames it to sougou.apk, and automatically installs the application.

  2. Upload the package over the internal network to a default OSS bucket that you own in the same region.

  3. Distribute the package over the internal network to other specified Cloud Phone instances in the same region, such as Cloud Phone instance 2 acp-5fc8mx8fnw9s5****, and then automatically install the application.

Note
  • In this scenario, the first Cloud Phone instance must have Internet access permissions and sufficient storage space. Otherwise, the application package cannot be downloaded and stored.

  • Compared to Scenario 3, this scenario reduces data transfer costs. However, because it uses a default OSS bucket as a transit point, it also incurs additional storage costs. Choose the scenario that best suits your needs.

SendFile API call example

  • Request message

    {
        "AndroidInstanceIdList": [
            "acp-c8rzmx8fnwba6****",
            "acp-5fc8mx8fnw9s5****"
        ],
        "SourceFilePath": "/sdcard/Download",
        "UploadType": "OSS_BRIDGED",
        "UploadUrl": "https://apkdl.example.com/wapdl/android/apk/SogouInput_12.15.0_android_sweb.apk",
        "UploadEndpoint": "oss-cn-hangzhou-internal.aliyuncs.com",
        "TargetFileName": "sougou.apk",
        "AutoInstall": "true"
    }
  • Response message

    {
      "TaskId": "t-gk0ahswe4blor****",
      "RequestId": "5D6FB544-F20E-14F8-B627-3F32C337****",
      "Data": [
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-c8rzmx8fnwba6****"
        },
        {
          "TaskId": "t-gk0ahswe4blor****",
          "AndroidInstanceId": "acp-5fc8mx8fnw9s5****"
        }
      ]
    }

What to do next

After the API call succeeds, you can call the DescribeTasks API to query the progress and status of the task using the returned TaskId.

Scenario comparison

  • Scenarios 1 and 2: If the file or application package that you want to distribute is stored in an OSS bucket in the same region as the Cloud Phone instances, Cloud Phone distributes it over the internal network. This process does not consume Internet traffic.

  • Scenario 3: If the file or application package that you want to distribute is on the Internet, Cloud Phone downloads multiple copies from the Internet and distributes them to your Cloud Phone instances. This process consumes Internet traffic.

  • Scenario 4: If the file or application package that you want to distribute is on the Internet, Cloud Phone downloads one copy of the file or package from the Internet. It then caches the copy in an OSS bucket that you own and is in the same region. Then, it distributes the copy to all other Cloud Phone instances over the internal network. This process consumes only a small amount of Internet traffic.