Set up a Mobile Center server on AWS

This section describes how to set up your environment to work with an off-premises Mobile Center server installed on an Amazon EC2 machine.

Set up your Amazon Environment

To set up your Amazon environment:

  1. Make sure you have an active Amazon Web Services (AWS) account. If you do not have one, create a new account.
  2. Allocate an EC2 Linux machine. Set up your machine according to the system requirements. A t2.large instance type is recommended.

  3. It is recommended that you create a Security group. For this group, add rules with custom type entries specifying the port that you will be specifying during the server installation.

  4. Create an EC2 instance. In the Configure Instance Details screen, make sure your IAM role includes access to the ADF (Amazon Device Farm) service. If you do not see this role in the drop-down, click Create a new role and locate the Device Farm Access service.
  5. Launch the instance.
  6. Copy the DNS name of the instance to your clipboard.

Install Mobile Center on the EC2 machine

To install Mobile Center on your EC2 machine:

  1. Log in to the EC2 machine using the DNS of the instance that you created above.

  2. Transfer the installation zip file for the platform of the machine that you allocated (Linux, Windows 64-bit, and so forth) onto the EC2 machine.

    Tip: For faster transfer of the file, first upload the file to Amazon S3

  3. Unzip the archive file.

  4. Run the installation script using the AWS flag:

    1. On a Linux machine, run the installer using the AWS flag:
      ./install_server-linux-x64-<Version>.bin -DUSER_INPUT_INSTALL_AWS_MODE=1 The installer prompts you for input.
    2. On a Windows machine, run the setup file using the AWS flag from a command prompt:
      install_server-windows-x64-<Version>.exe -DUSER_INPUT_INSTALL_AWS_MODE=1 The wizard opens. Follow the instructions as they appear.
  5. When prompted for a server address, paste in the DNS of the instance you created above.
  6. Specify that the connection to the server should be non-SSL.

  7. To verify the device farm integration from other cloud vendors, enter aws devicefarm list-projects as a shell command.
  8. Optional: After you install the content pack, you can set the maximum replay time, which is by default 3600 seconds, 1 hour. Locate the applicationContext.xml file in the classes folder under your server or connector installation. Modify the value of the uia_message_timeout argument, providing a value in seconds.

Run tests on the EC2 machine

Once you have set up your environment, use your testing tool to select devices, choose apps, and run the test.

  1. Paste the DNS of the instance you created above into your browser.
  2. Log in to the Mobile Center server.
  3. Go to the Administration tab and click Settings. Expand the Amazon Device Farm integration settings, and Enable the ADF connector. Set the Whitelisted setting to No.
  4. Optionally provide Amazon key pair in the Amazon Device Farm integration settings. If you do not specify a key pair, the test will use the EC2 machine's key pair. If you do specify a key pair, these values will override the ones on the EC2 machine.
  5. Using your testing tool, open the Mobile Center Wizard which opens to the Device selection window.

    1. In the Choose Capabilities pane, make sure Amazon Lab is included in the Target Lab section.
    2. Choose a device based on your filter or rule.
    3. Click the App tab and select one or more apps.
    4. In the Test options tab, select Install to install the app on the device before running the test.
    5. Click Save and Close.
  6. Start the test run from the testing tool. You may notice a delay the first time you run a test, since the device farm requires several minutes to allocate the device.

    Tip: If your test fails due to timeouts, add a Wait step to compensate for extra network activity.

When the test is actively running, you will be able to see the ADF device on the Mobile Center console's Device tab.

Note: The device ID of an ADF device has an AWS prefix.

You can track the project's progress on the EC2 console, under the AWS Device Farm service.

Back to top

Obtain logs

After a test run, you can view the logs in the following ways:

  • For non-admin users:
    To obtain device/app logs: Open the Amazon console and go to the Services > AWS Device Farm section. Locate your project and click on it. Next, click on the device. The console displays the Device ID with an <MC-user name> prefix. Open the Files tab. Select the device's log, Logcat for Android, or idevicesyslog for iOS.
  • For administrators:
    To obtain server logs, use the Collect Logs feature. For details, see Viewing system information and logs.

Note: Logs are only available after the device is deallocated, For example, in UFT attended mode, when you close the solution or when it reaches the idle timeout.

Mobile Center automatically deallocates a device upon test completion or after an idle time of 5 minutes when no tests are being run on the device.

Back to top

See also: