Help Center> > Getting Started >Trying Cloud Phones

Trying Cloud Phones

You can experience the trial cloud phones without paying for them. Limited trial cloud phones are provisioned only to enterprise users. Figure 1 shows how to experience the trial cloud phones.

The trial cloud phones have the following restrictions:

  • The number of trial cloud phones is limited, so we do not ensure there is always trial phones available.
  • By default, the trial cloud phones are released 7 days later, and the trial data is not to be retained. If you want to continue using Cloud Phone, apply for extension before the trial expires.
  • You cannot call Cloud Phone APIs for secondary development when you are using trial cloud phones.
Figure 1 Cloud phone trial flowchart
Table 1 Process description

Process

Description

Making Preparations

  • Register with HUAWEI CLOUD and perform real-name authentication.
  • Create a key pair for authentication. A key pair is required to access the trial cloud phone during the trial cloud phone application.

Applying for a Trial Cloud Phone

Apply for a trial cloud phone with a few clicks. If the cloud phone servers are sufficient, the system automatically provisions a cloud phone.

Accessing a Cloud Phone

  • Establish an SSH tunnel.
  • Access the cloud phone through Android Debug Bridge (ADB).
NOTE:

You can only use ADB to access a trial cloud phone. VNC is not supported.

Displaying Cloud Phone Images

After accessing a cloud phone, you need to use a tool to obtain the cloud phone images. Airtest is recommended.

Making Preparations

Preparations include two tasks: Register with HUAWEI CLOUD and perform real-name authentication. Create a key pair for authentication. A key pair is required to access the trial cloud phone (when establishing an SSH tunnel).

  1. Register with HUAWEI CLOUD and complete real-name authentication.

    1. Visit https://www.huaweicloud.com/en-us/ and click Register.
    2. On the displayed Register page, register an account as prompted. For details, see Registering on the HUAWEI CLOUD Management Console.

      After the registration, the system automatically redirects you to your personal information page.

    3. Complete real-name authentication by following the instructions in Individual Real-Name Authentication.

  2. Create a key pair.

    If you plan to apply for trial cloud phones in multiple regions, you need to create a key pair in each region.

    1. Log in to the management console.
    2. Under Computing, select Elastic Cloud Server.
    3. In the navigation pane on the left, choose Key Pair.
    4. On the right side of the page, click Create Key Pair.
    5. Enter the key name and click OK.

      An automatically allocated key name consists of KeyPair- and a 4-digit random number. Change it to an easy-to-remember one, for example, KeyPair-xxxx_cph.

      Figure 2 Create Key Pair
    6. Manually or automatically download the private key file. The file name is the specified key pair name with a suffix of .pem. Securely store the private key file. In the displayed dialog box, click OK.

      This is the only opportunity for you to save the private key file. Keep it secure. When applying for a trial cloud phone, you need to select a key pair. When establishing an SSH tunnel, you need to provide a complete path for storing the private key.

Applying for a Trial Cloud Phone

  1. On the management console, click Service List. Under Computing, select Cloud Phone.
  2. On the Free Trial page, select a cloud phone type and click Try for Free.
  3. In the displayed Apply for Trial dialog box, select the key pair created in Making Preparations and click OK.
    Figure 3 Apply for Trial

    If no key pair has been created, you can click Create Key Pair to go to Cloud Server Console and create a key pair.

    Wait for 1 to 2 minutes and refresh the page. Then you can see the provisioned trial cloud phone.

    Figure 4 App hosting cloud phone

Accessing a Cloud Phone

To access a cloud phone, you need to establish an SSH tunnel, and then access the cloud phone through ADB.

  1. Establish an SSH tunnel.

    1. Ensure that the SSH service has been installed on the physical device (such as the local PC) used to access the cloud phone.
      1. Open the command-line interface (CLI) on the local PC. The following uses Windows 10 as an example:

        Press Win+R, enter cmd in the Run dialog box, and press Enter.

      2. Enter the ssh command and press Enter.
        • If no error is reported and the following information is displayed, SSH is installed on the system.

        • If the following error message is displayed, download SSH, such as OpenSSH.

          You can download SSH from the following link: https://www.mls-software.com/files/setupssh-8.1p1-1.exe

    2. Run the following command in the CLI window to establish an SSH tunnel:

      ssh -L Local idle port: Cloud phone listening IP address SSH tunnel username@Public IP address -i Private key file path -Nf

      The parameters are described as follows:

      • Local idle port: Any idle port on the local device selected by you. The port is mapped to the cloud phone application port.

        You can run the netstat -an command on CLI to check the port usage. As shown in the following figure, port 6667 is occupied by another program, and port 1234 is idle.

      • Cloud phone listening address: internal IP address and port number of the cloud phone

        To obtain the information, perform the following operations:

        1. Click the trial cloud phone name to go to the cloud phone details page.

        2. In the Application Port area, obtain the listening IP address of the cloud phone.

      • SSH tunnel username: project ID of the region where the cloud phone is located

        To obtain the information, perform the following operations:

        1. Locate the username in the upper right corner, hover the mouse over it, and select My Credentials from the drop-down list.

        2. Choose API Credentials. In the Projects area, obtain the project ID of the region where the cloud phone to be accessed is located.

          Example: region CN East-Shanghai1

          If the project ID contains more than 32 characters, the first 32 characters are used as the username of the SSH tunnel to be established.

      • Public IP Address: public IP address of the cloud phone server

        To obtain the information, perform the following operations:

        1. Click the trial cloud phone name to go to the cloud phone details page.

        2. In the Application Port area, obtain the public IP address of the SSH tunnel.

      • Private key file path: local path for storing the key pair of the cloud phone server, that is, the key pair created in Making Preparations. The path is case insensitive.

      Assume that the local idle port number is 1234, the listening IP address of the cloud phone is 10.237.0.54:5555, the SSH tunnel username is 05e1aexxx, the public IP address is xxx.xxx.xxx.xxx, and the private key file path is C:/Users/Administrator/Downloads/KeyPair-a49c.pem. Run the following command:

      ssh -L 1234:10.237.0.54:5555 05e1aexxx@xxx.xxx.xxx.xxx -i C:\Users\Administrator\Downloads\KeyPair-a49c.pem -Nf

      This command sets up an SSH tunnel from the local PC to the cloud phone, uses the local port forwarding mode, and listens to port 1234 of the local PC. When port 1234 of the local PC is accessed, the communication data is forwarded to port 5555 of the cloud phone.

      After the command is executed, the SSH program forwards packets through the tunnel in the background. If no error is reported, the SSH tunnel is successfully established.

  2. Access the cloud phone through ADB.

    1. Download ADB.

      Visit https://developer.android.com/studio/releases/platform-tools, switch the language to English in the upper right corner, and choose Download SDK Platform-Tools for Windows.

      In the displayed dialog box, select the I have read and agree with the above terms and conditions check box, and click DOWNLOAD ANDROID SDK PLATFORM-TOOLS FOR WINDOWS.

    2. Decompress the platform-tools_r29.0.5-windows.zip file to a specified directory, for example, C:\Users\Administrator\Downloads.

      Version number 29.0.5 in the platform-tools_r29.0.5-windows.zip file is only an example.

    3. Open the CLI and go to the C:\Users\Administrator\Downloads\platform-tools directory.

      cd C:\Users\Administrator\Downloads\platform-tools

    4. Run the following ADB command to create an ADB connection to the cloud phone:

      adb connect 127.0.0.1: Local idle port

      Local idle port is the idle port used in 1.

    5. Run the adb devices command to check whether the current port is connected.

    6. (Optional) Install the mobile phone APK to the cloud phone.

      Currently, Cloud Phone does not have built-in browsers or app stores. If you want to install an app on a cloud phone, you can find an APK and run the ADB command to transfer the package to the cloud phone. The installation command is as follows:

      adb -s 127.0.0.1:local idle port install APK path

      Example:

Display Cloud Phone Images

After accessing a cloud phone, you are advised to use Airtest to quickly obtain images of the cloud phone.