Working with UI Automation for iOS and AWS Device Farm - AWS Device Farm

Working with UI Automation for iOS and AWS Device Farm

Device Farm provides support for UI Automation for iOS.

What Is UI Automation?

You can use the Automation instrument to automate user interface tests in your iOS app through test scripts that you write. These scripts run outside of your app and simulate user interaction by calling the UI Automation API. The API is a JavaScript programming interface that specifies actions to be performed in your app as it runs in the simulator or on a connected device. For more information, see About Instruments in the Instruments User Guide of the iOS Developer Library.

Upload Your iOS UI Automation Tests

Use the Device Farm console to upload your tests.

  1. Sign in to the Device Farm console at

  2. In the list of projects, choose the option next to the project where you want to upload your tests.


    If the list of projects is not displayed, then on the secondary navigation bar, for Projects, choose the name of the project that you want to upload your tests to.

    To create a project, follow the instructions in Create a Project in AWS Device Farm.

  3. If the Create a new run button is displayed, choose it.

  4. On the Choose your application page, choose Upload.

  5. Browse to and choose your iOS app file. The file must be an .ipa file.


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

  6. Choose Next step.

  7. On the Configure a test page, choose UI Automation, and then choose Upload.

  8. Browse to and choose the .js file for a single test.

  9. Choose Next step, and then complete the remaining instructions to select the devices to run your tests on and start the run.

Taking Screenshots in iOS UI Automation Tests

You can take screenshots as part of your iOS UI Automation tests.

To take a screenshot, call the captureScreenWithName function (for example, target.captureScreenWithName(lang + "_home");, where lang is the current language name).

Additional Considerations for iOS UI Automation Tests

Device Farm adds logging hooks so that it can monitor the execution flow of iOS UI Automation tests, but Device Farm does not modify iOS UI Automation tests themselves.