Help Center/ Cloud Phone Host/ Getting Started/ Purchasing a Cloud Phone Server
Updated on 2024-07-31 GMT+08:00

Purchasing a Cloud Phone Server

If you want to experience more CPH functions (such as APIs) or deploy real services after learning about the CPH advantages and application scenarios, purchase a cloud phone server. Figure 1 shows how to buy a cloud phone.

Figure 1 Process of buying a cloud phone server

Table 1 Process description

Process

Description

Making Preparations

  • Register with Huawei Cloud and complete real-name authentication.
  • Create a key pair, which is required for authentication during access to the cloud phone.

Purchasing a Cloud Phone Server

Cloud phones are automatically created by the system after you purchase a server. Parameters such as cloud phone specifications and OS can be set during the server purchase process.

Accessing the Cloud Phone

Use ADB to access the cloud phone with a few clicks.

Displaying the Cloud Phone Screens

After accessing the cloud phone, use a tool to obtain the cloud phone screens. Airtest is recommended.

Making Preparations

Register with Huawei Cloud and complete real-name authentication. Create a key pair for authentication. Create a key pair, which is required for authentication when you set up an SSH tunnel to access the cloud phone.

  1. Register with Huawei Cloud and complete real-name authentication.

    1. Visit https://www.huaweicloud.com/intl/en-us/ and click Register.
    2. Complete the registration as prompted.For details, see Registering with Huawei Cloud.

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

    3. Complete individual or enterprise real-name authentication. For details, see Individual Real-Name Authentication or Enterprise Real-Name Authentication.

  2. Create a key pair.

    If you plan to purchase servers in multiple regions, create a key pair in each region. For more information about regions, see Regions and AZs. The following describes how to create a key pair in the CN-Hong Kong 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 pair name and click OK.

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

      Figure 2 Create Key Pair
    6. Download the private key pair file. The file name is the specified key pair name with a suffix of .pem. Store the private key file in a secure path. In the displayed Information dialog box, click OK.

      The private key file can be downloaded only once, so keep it secure. When purchasing a server, select the key pair. When establishing an SSH tunnel to the cloud phone, provide the complete path for storing the private key.

Purchasing a Cloud Phone Server

Purchase a cloud phone server. The system automatically creates cloud phones on the server.

  1. In the upper left corner of the CPH console, select the closest region to your location to reduce likelihood of latency issues.
  2. In the navigation pane on the left, choose Servers. In the upper right corner, click Buy Server.
  3. In the Configure Basic Settings step, select the server type, instance specifications, and phone image based on the site requirements, and click Next: Configure Network.

    Not all parameters are covered here. For details about all the parameters, see Buying a Cloud Phone (with Detailed Parameter Description).

    In the Instance Specifications area, Quantity indicates the number of cloud phones that can be virtualized from a server. For example, if Quantity is set to 15, 15 cloud phones can be virtualized from the server.

  4. In the Configure Network step, retain the default value Dedicated for Bandwidth Type and click Next: Configure Advanced Settings.
    Figure 3 Configure Network
  5. In the Configure Advanced Settings step, select the key pair created in Making Preparations and set the user-defined network and application port as required.
    Figure 4 Advanced Settings
    • Key Pair: used for authentication when you establish an SSH tunnel to the cloud phone.

      If no key pair has been created, you can click Create Key Pair to create a key pair.

    • User-defined Network: To customize the network segment where the server is located, select User-defined Network for Advanced Settings, and enter the VPC subnet and the CIDR block.
    • Application Port: By default, only the ADB port is accessible on the Internet. Configure a maximum of five additional ports to be accessible on the Internet.
  6. Click Next: Confirm. After confirming the configuration, set the required duration and quantity, select I have read and agree to the OBT Trial Use Agreement, and click Buy Now.
  7. Wait until the server is created successfully.

Accessing a Cloud Phone

You can use ADB to quickly access your cloud phone on the CPH console.

  1. On the Instances page, locate the target cloud phone, and choose More > Access Through ADB in the Operation column.

    The right pane is displayed.

    Figure 5 Access Through ADB
  2. Specify the following parameters:
    • Key File Path: Enter the local path for storing the private key file of the server, for example, C:\Users\Administrator\Downloads\KeyPair-a49c.pem.
    • platform-tools: Click Download ADB and decompress the tool package to the selected directory, for example, C:\Users\Administrator\Downloads\platform-tools.
    • Local Available Port: Enter a local idle port.

      Run the netstat -an command to check whether the port is idle.

      As shown in the following figure, port 6667 is occupied (displayed as Listening) by another program, and port 1234 is idle.

    After you set the three parameters, the command is automatically filled in the blank area in the lower part of the right panel. You only need to perform operations as prompted to access the cloud phone.

    For details about the parameters in the command for establishing an SSH tunnel, see ADB (Internet).

Displaying the Cloud Phone Screens

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