Skip to main content
Transform your testing process with: Real Device Features, Company-wide Licences, & App Percy
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Build and export your test suite for XCUI tests

Build and export your test package (.zip) file, upload it to BrowserStack and execute your XCUITest mobile automation tests on BrowserStack App Automate.

To test your native and hybrid iOS apps on BrowserStack using XCUITest, you need to build and upload both the app (.ipa file) and the XCUI test suite (.zip file) to BrowserStack. If you do not have a .zip file for your test suite, follow the step-by-step instructions on this page to generate the .zip file.

You can generate the .zip file using Xcode or command-line tools:

  1. From the schemes dropdown, select the app scheme, and set the device to Generic iOS device.

  2. Select Product → Clean (Cmd Shift K).

  3. Select Product → Build For → Testing (Cmd Shift U).

  4. Use Xcode’s Project Navigator to right-click the .app file and select Show in Finder.

  5. In Finder, select the appropriate <AppnameUITests>-Runner.app and choose the compress option. This generates the <AppnameUITests>-Runner.zip file.

Generate the zip file in Finder by selecting the appropriate Runner.app

Select the .app file and choose the compress option

You can automate the process using the following steps:

  1. Build the project for testing. Change to the project directory and run the following command:

    xcodebuild -scheme <scheme-name> build-for-testing

  2. From the command line, change to the derivedData directory. To know the location of your derivedData directory, visit Xcode → Preferences → Locations.

  3. To create the zip file, run the following commands:

cd <app_name>-<random_characters>

# You can get the exact name of the last updated directory by running ls -lrt
cd Build/Products
cd Debug-iphoneos
zip --symlinks -r <MyAppUITests>.zip <AppnameUITests>-Runner.app

Once the .zip file is ready, upload it to BrowserStack servers using our REST API.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle