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:
-
From the schemes dropdown, select the app scheme, and set the device to Generic iOS device.
-
Select Product → Clean (
Cmd Shift K). -
Select Product → Build For → Testing (
Cmd Shift U). -
Use Xcode’s Project Navigator to right-click the
.appfile and select Show in Finder. -
In Finder, select the appropriate
<AppnameUITests>-Runner.appand choose the compress option. This generates the<AppnameUITests>-Runner.zipfile.


You can automate the process using the following steps:
-
Build the project for testing. Change to the project directory and run the following command:
xcodebuild -scheme <scheme-name> build-for-testing -
From the command line, change to the derivedData directory. To know the location of your derivedData directory, visit Xcode → Preferences → Locations.
-
To create the
zipfile, 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.
Related topics
-
Manage your uploaded app or test suite using our upload app REST API and upload test suite REST API.
-
Use the get app API endpoint and list test suites API endpoint to list your recently uploaded apps and test suites.
-
Delete your uploaded app or test suite using the delete app API endpoint and delete test suite API endpoint.
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
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!