Building XCUITest
To test with XCUITest on TestingBot, you will need to build and export the XCUITests you have created.
If you do not have a zip file of the XCUITest suite, you can follow the examples below.
The zip file should contain a folder similar to this:
Copy
xcuitest-sampleUITests-Runner.app
Using XCode (13 and higher)
- From the XCode schemes dropdown menu, select your app scheme and Any iOS Device as device
- Click Product -> Clean (
Cmd+Shift+K) - Click Product -> Build For -> Testing (
Cmd+Shift+U) - Go to Product -> Show Build Folder in Finder
- In Finder, navigate to Products -> Debug-iphoneos. The directory should contain a file that ends with
-Runner.app.
Right click and choose the compress option to generate azipfile.
Using XCode (Lower than 13.0)
- From the XCode schemes dropdown menu, select your app scheme and Generic iOS device as device
- Click Product -> Clean (
Cmd+Shift+K) - Click Product -> Build For -> Testing (
Cmd+Shift+U) - Right click the
.appfile using the Project Navigator, and select Show in Finder - In Finder, the directory should contain a file called
<AppnameUITests>-Runner.app.
Right click and choose the compress option to generate azipfile.
Using Command Line
To build the .zip file from the command line, please follow these steps:
-
Change to the project directory and build for testing:
Copyxcodebuild -scheme <scheme-name> build-for-testing - Go to the DerivedData directory. To know the location of this directory, open Xcode and go to Preferences -> Locations.
-
Now you can create the zip file. In the DerivedData directory, go to the directory containing the name of your app and some random characters.
Copycd appname-random_characters cd Build/Products cd Debug-iphoneos zip --symlinks -r <MyAppUITests>.zip <AppnameUITests>-Runner.app