xcode_test
Execute test suites for an Xcode project. Optionally run specific test methods or classes by temporarily altering the test plan, automatically restored afterward. Supports XCTest and Swift Testing frameworks.
Instructions
Run tests for a specific project. Optionally run only specific tests or test classes by temporarily modifying the test plan (automatically restored after completion). ⏱️ Can take minutes to hours - do not timeout.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| xcodeproj | Yes | Absolute path to the .xcodeproj file (or .xcworkspace if available) - e.g., /path/to/project.xcodeproj | |
| destination | Yes | Test destination (required for predictable test environments) - e.g., "iPhone 15 Pro Simulator", "iPad Air Simulator" | |
| command_line_arguments | No | Additional command line arguments | |
| test_plan_path | No | Optional: Absolute path to .xctestplan file to temporarily modify for selective test execution | |
| selected_tests | No | Optional: Array of specific test identifiers to run. Format depends on test framework: XCTest: "TestAppUITests/testExample" (no parentheses), Swift Testing: "TestAppTests/example". Requires test_plan_path. | |
| selected_test_classes | No | Optional: Array of test class names to run (e.g., ["TestAppTests", "TestAppUITests"]). This runs ALL tests in the specified classes. Requires test_plan_path. | |
| test_target_identifier | No | Optional: Target identifier for the test target (required when using test filtering). Can be found in project.pbxproj. | |
| test_target_name | No | Optional: Target name for the test target (alternative to test_target_identifier). Example: "TestAppTests". |