Customer Cases
Pricing
XCTest Test
Help Documents menu

XCTest Test

Updated on: 2025-03-25 14:27

Introduction to XCTest

XCTest is the testing framework supplied by Apple. You can create unit tests in your Xcode project. Please refer to Apple Developer Official Doc for detailed introduction.

Running XCTest on WeTest Cloud Servers

WeTest launches your uploaded XCTest packages on target mobile devices in parallel. You may specify different versions to run your tests.

Xcode versions:

  1. Xcode 14 is provided for devices with iOS from 11.0 to 14.0
  2. Xcode 16.2 is provided for devices with iOS 15 or above.

Please follow the steps below to prepare your XCTest/XCUITest script(.zip file) for uploading to WeTest and start your test!

Prepare your XCTest zip package

1. Build your project

Option1

Please use following command line to build your project.

xcodebuild -project YOUR_PROJECT.xcodeproj \
-scheme YOUR_SCHEME \
-derivedDataPath DERIVED_DATA_OUTPUTPATH \
-sdk iphoneos build-for-testing

Option2:

In Xcode, Click Product -> Buld For -> Testing to build your project.

2. Create a script package

WeTest accepts a zip file as the script package. Please zip all test script files(.xctestrun files and Debug-iphoneos directory) and/or a config file (xctest_config.json) into one .zip file.

cd DerivedData/yourProject/Build/Products 
zip -r TestsOnWeTest.zip Debug-iphoneos   your_xctestrun_file.xctestrun

Sample Script running on WeTest

iOS XCTest Test Script

Sample Script - iOS XCTest