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.
Topics
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 Test frameworks and built-in tests 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.
Sign in to the Device Farm console at https://console.aws.amazon.com/devicefarm
.
Step 2: Create a project
To test an app in Device Farm, you must first create a project.
-
In the navigation pane, choose Mobile Device Testing, and then choose Projects.
-
Under Mobile Device Testing Projects, choose New project.
-
Under Create project, enter a Project Name (for example,
MyDemoProject
). -
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.
-
On the Automated tests page, choose Create a new run.
-
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.
-
Enter a Run name, such as
my first test
. By default, the Device Farm console uses the file name. -
Choose Next.
-
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 Test frameworks and built-in tests 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 Running Device Farm's built-in fuzz test (Android and iOS).
-
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.
-
-
Choose Next.
-
On the Select devices page, for Device pool, choose Top Devices.
-
Choose Next.
-
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.
-
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.
Note
Setting the device radio state and locale are options only available for Android native tests at this time.
-
-
Choose Next.
-
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 in the device table, then switches to the running icon 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 Viewing test reports in Device Farm.
Next steps
For more information about Device Farm, see Concepts.