Getting started with Device Farm - AWS Device Farm

Getting started with Device Farm

This walkthrough shows you how to use Device Farm to test a native Android or iOS app. You use the Device Farm console to create a project, upload an .apk or .ipa file, run a suite of standard tests, and then view the results.

Note

Device Farm is available only in the us-west-2 (Oregon) AWS Region.

Prerequisites

Before you begin, make sure you have completed the following requirements:

  • Complete the steps in Setting Up. You need an AWS account and an AWS Identity and Access Management (IAM) user with permission to access Device Farm.

  • For Android, you need an .apk (Android app package) file. For iOS, you need an .ipa (iOS app archive) file. You upload the file to Device Farm later in this walkthrough.

    Note

    Make sure that your .ipa file is built for an iOS device and not for a simulator.

  • (Optional) You need a test from one of the testing frameworks that Device Farm supports. You upload this test package to Device Farm, and then run the test later in this walkthrough. If you don't have a test package available, you can specify and run a standard built-in test suite. For more information, see Working with Test Types in AWS Device Farm.

Step 1: Sign in to the console

You can use the Device Farm console to create and manage projects and runs for testing. You learn about projects and runs later in this walkthrough.

Step 2: Create a project

To test an app in Device Farm, you must first create a project.

  1. In the navigation pane, choose Mobile Device Testing, and then choose Projects.

  2. Under Mobile Device Testing Projects, choose New project.

  3. Under Create project, enter a Project Name (for example, MyDemoProject).

  4. Choose Create.

    The console opens the Automated tests page of your newly created project.

Step 3: Create and start a run

Now that you have a project, you can create and then start a run. For more information, see Runs.

  1. On the Automated tests page, choose Create a new run.

  2. On the Choose application page, under Mobile App, choose Choose File, and then choose an Android (.apk) or iOS (.ipa) file from your computer. Or, drag the file from your computer and drop it in the console.

  3. Enter a Run name, such as my first test. By default, the Device Farm console uses the file name.

  4. Choose Next.

  5. On the Configure page, under Setup test framework, choose one of the testing frameworks or built-in test suites. For information about each option, see Working with Test Types in AWS Device Farm.

    • If you have not yet packaged your tests for Device Farm, choose Built-in: Fuzz to run a standard, built-in test suite. You can keep the default values for Event count, Event throttle, and Randomizer seed. For more information, see Working with the Built-in Fuzz Test for Device Farm.

    • If you have a test package from one of the supported testing frameworks, choose the corresponding testing framework, and then upload the file that contains your tests.

  6. Choose Next.

  7. On the Select devices page, for Device pool, choose Top Devices.

  8. Choose Next.

  9. On the Specify device state page, do any of the following:

    • To provide additional data for Device Farm to use during the run, under Add extra data, upload a .zip file.

    • To install other apps for the run, under Install other apps, upload the .apk or .ipa files for the apps. To change the installation order, drag and drop the files.

    • To turn on Wi-Fi, Bluetooth, GPS, or NFC radios for the run, under Set radio states, select the corresponding check boxes.

      Note

      Setting the device radio state is available only for Android native tests at this time.

    • To test location-specific behavior during the run, under Device location, specify preset Latitude and Longitude coordinates.

    • To preset device language and region for the run, under Device locale, choose a locale.

    • To preset the network profile for the run, under Network profile, choose a curated profile. Or, choose Create network profile to create your own.

  10. Choose Next.

  11. On the Review and start run page, choose Confirm and start run.

Device Farm starts the run as soon as devices are available, typically within a few minutes. To view the run status, on the Automated tests page of your project, choose the name of your run. One the run page, under Devices, each device starts with the pending icon 
        Device Farm scheduled a job.
    in the device table, then switches to the running icon 
        Device Farm progress indicator.
    when the test begins. As each test finishes, the console displays a test result icon next to the device name. When all tests are complete, the pending icon next to the run changes to a test result icon.

Step 4: View the run's results

To view test results from the run, on the Automated tests page of your project, choose the name of your run. A summary page displays:

  • The total number of tests, by outcome.

  • Lists of tests with unique warnings or failures.

  • A list of devices with test results for each.

  • Any screenshots captured during the run, grouped by device.

  • A section to download the parsing result.

For more information, see Working with test reports in Device Farm.

Next steps

For more information about Device Farm, see Concepts.