Skip to content

Test ​

Running geko test without arguments tests all workspace schemes generated by Workspace.GenerationOptions.autogeneratedWorkspaceSchemes:

bash
geko test

Specify the scheme you want to test:

bash
geko test MainApp

Test a specific module's scheme, for example Framework2:

bash
geko test Framework2

Selecting tests ​

Specify which tests to run. The list of test identifiers you want to test. The expected format is TestTarget[/TestClass[/TestMethod]]:

bash
geko test MainApp --test-targets Framework2Tests/MyPublicClassTests Framework2Tests/Framework2Tests

Specify a test plan:

bash
geko test MainApp --test-plan GeneratedTestPlan

The --edit-test-plan flag edits the list of test targets in the test plan (passed via --test-plan) and adds the test targets passed via the --test-targets argument to that list, or adds all of them if the argument was not passed:

bash
geko test MainApp --edit-test-plan

Controlling the test action ​

By default, geko test runs the xcodebuild test action: it builds the project and then runs the tests. Two flags change this behaviour and map to different xcodebuild actions.

--build-only ​

Build the tests but do not run them. This corresponds to the xcodebuild build-for-testing action and is useful for validating that the project compiles into test bundles without executing them:

bash
geko test MainApp --build-only

--without-building ​

Run the tests without building. This corresponds to the xcodebuild test-without-building action and is useful when the test bundles were already built, for example to re-run tests from a previous build:

bash
geko test MainApp --without-building

The two flags are mutually exclusive — passing both causes an error.

Choosing a destination ​

Pass a build destination directly to xcodebuild with the -destination flag:

bash
geko test MainApp -- -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.5'

Passing arguments to xcodebuild ​

Any arguments placed after the -- terminator are passed through to xcodebuild verbatim. This lets you use any xcodebuild option that is not exposed as a dedicated geko test flag, for example to select a destination or to enable parallel testing:

bash
geko test MainApp -- -destination 'platform=iOS Simulator,name=iPhone 17 Pro,OS=26.5' -parallel-testing-enabled YES

Arguments that cannot be passed through ​

Some xcodebuild arguments are blocked and cannot be passed after the -- terminator, because they are already handled by Geko itself through dedicated flags:

ArgumentWhy it is not available
-schemeThe scheme is chosen with the positional scheme argument (geko test <scheme>).
-workspaceGeko generates and selects the workspace to test.
-projectGeko generates and selects the Xcode project to test.
-testPlanHandled by the --test-plan flag.
-only-testingHandled by the --test-targets flag.
-skip-testingHandled by the --skip-test-targets flag.
-only-test-configurationHandled by the --filter-configurations flag.
-skip-test-configurationHandled by the --skip-configurations flag.

In addition, the xcodebuild action verbs test, build-for-testing, and test-without-building cannot be passed after the -- terminator. geko test already picks the action based on its own flags: test by default, build-for-testing with --build-only, and test-without-building with --without-building. Passing one of these verbs would conflict with the action Geko chooses.