Working with XCTest UI Testing Framework for iOS and AWS Device Farm - AWS Device Farm

Working with XCTest UI Testing Framework for iOS and AWS Device Farm

Device Farm provides support for XCTest UI testing framework for iOS. Specifically, Device Farm supports XCTest UI tests written in both Objective-C and Swift.

What Is XCTest UI Testing Framework?

XCTest UI framework is the new testing framework introduced with Xcode 7. This framework extends XCTest with UI testing capabilities. For more information, see User Interface Testing in the iOS Developer Library.

Prepare Your iOS XCTest UI Tests

Your iOS XCTest UI test runner bundle must be contained in a properly formatted .ipa file.

To create an .ipa file, place your bundle in an empty Payload directory. Next, archive the Payload directory into a .zip file and then change the file extension to .ipa. The * bundle is produced by Xcode when you build your project for testing. It can be found in the Products directory for your project.

Upload Your iOS XCTest UI 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 where you want to upload your tests.

    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 XCTest UI, and then choose Upload.

  8. Browse to and choose the .ipa file that contains your iOS XCTest UI test runner.

  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 XCTest UI Tests

XCTest UI tests capture screenshots automatically for every step of your tests. These screenshots are displayed in your Device Farm test report. No additional code is required.