Let's pay attention to the parameters:
batches is an array with your tests. It should be used if you want to explicitly specify which tests should be run on each simulator. In the array, you must specify the path to your test according to the following scheme: Test target name/ Class name with tests/ Test name.
destination is an argument where you can specify a specific: simulator, physical device, mac.
Let's analyze destination in more detail:
- The full name of the simulator, which can be found in “Devices and Simulators”
- UDID of your device. UDID can be obtained using the simctl utility
- iOS version, tvOS, watchOS. Specify the version supported by Xcode
A few examples to understand destination:
We indicate the iPhone X simulator on OS version 13.1.
-destination 'platform=iOS Simulator,name=iPhone X,OS=13.1'
Specify the simulator using the simulator's UDID.
-destination 'platform=iOS Simulator,id=6DC4A7BA-EA7F-40D6-A327-A0A9DF82F7F6'
The most important
Parallelizing tests allows you to speed up your tests by several times!
You can do this locally through xcode, but it will divide them by class, not by an equal number.
To parallelize tests on ci, use the multi_scan plugin for fastlane. The implementation is very simple, and there is a lot of profit.
Test parallelization is a simple and very useful tool to speed up your tests, which I recommend to everyone.