Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

xcodebuild-test

Execute unit and UI tests for Xcode projects with smart defaults that remember successful configurations and suggest optimal simulators, providing detailed test metrics with progressive disclosure to prevent token overflow.

Instructions

xcodebuild-test

Run Xcode tests with intelligent defaults and progressive disclosure

What it does

Executes unit and UI tests for Xcode projects with advanced learning that remembers successful test configurations and suggests optimal simulators per project. Provides detailed test metrics (passed/failed/skipped) with progressive disclosure to prevent token overflow. Supports test filtering (-only-testing, -skip-testing), test plans, and test-without-building mode for faster iteration. Learns from successful test runs to improve future suggestions.

Why you'd use it

  • Automatic smart defaults: remembers which simulator and config worked for tests

  • Detailed test metrics: structured pass/fail/skip counts instead of raw output

  • Progressive disclosure: concise summaries with full logs available via testId

  • Test filtering: run specific tests or skip problematic ones with -only-testing/-skip-testing

Parameters

Required

  • projectPath (string): Path to .xcodeproj or .xcworkspace file

  • scheme (string): Test scheme name (use xcodebuild-list to discover)

Optional

  • configuration (string, default: 'Debug'): Build configuration (Debug/Release, defaults to cached or "Debug")

  • destination (string): Test destination (e.g., "platform=iOS Simulator,id=")

  • sdk (string): SDK to test against (e.g., "iphonesimulator")

  • derivedDataPath (string): Custom derived data path

  • testPlan (string): Test plan name to execute

  • onlyTesting (string[]): Array of test identifiers to run exclusively

  • skipTesting (string[]): Array of test identifiers to skip

  • testWithoutBuilding (boolean): Run tests without building (requires prior build)

Returns

Structured JSON with testId (for progressive disclosure), success status, test summary (total/passed/failed/skipped counts), failure details (first 3 failures), and cache metadata showing which smart defaults were applied. Use xcodebuild-get-details with testId for full logs.

Examples

Run all tests with smart defaults

const result = await xcodebuildTestTool({
  projectPath: "/path/to/MyApp.xcodeproj",
  scheme: "MyApp"
});

Run specific tests only

const filtered = await xcodebuildTestTool({
  projectPath: "/path/to/MyApp.xcworkspace",
  scheme: "MyApp",
  onlyTesting: ["MyAppTests/testLogin", "MyAppTests/testLogout"]
});

Fast iteration with test-without-building

const quick = await xcodebuildTestTool({
  projectPath: "/path/to/MyApp.xcodeproj",
  scheme: "MyApp",
  testWithoutBuilding: true
});

Complete JSON Examples

Run All Tests

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp"}

Run Specific Test Plan

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "testPlan": "IntegrationTests"}

Run Only Specific Tests

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "onlyTesting": ["MyAppTests/LoginTests", "MyAppTests/AuthTests/testLogin"]}

Skip Specific Tests

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "skipTesting": ["MyAppTests/SlowTests", "MyAppUITests"]}

Test Without Building (Using Previous Build)

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "testWithoutBuilding": true}

Test with Specific Destination

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "destination": "platform=iOS Simulator,name=iPhone 16 Pro,OS=18.0"}

Release Configuration Testing

{"projectPath": "/path/to/MyApp.xcodeproj", "scheme": "MyApp", "configuration": "Release"}
  • xcodebuild-build: Build before testing

  • xcodebuild-get-details: Get full test logs (use with testId)

  • simctl-list: See available test simulators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectPathYes
schemeYes
configurationNoDebug
destinationNo
sdkNo
derivedDataPathNo
testPlanNo
onlyTestingNo
skipTestingNo
testWithoutBuildingNo
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses learning behavior (remembers configs), progressive disclosure (testId for logs), and test-without-building efficiency. Lacks mention of rate limits or error handling, but otherwise thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is long but well-structured with headings, bullet points, and examples. It is front-loaded with a summary. Every section adds value, though some details could be condensed for an AI agent.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity (10 params, no output schema, no annotations), the description is highly complete: covers purpose, usage, parameters, return values (progressive disclosure), examples, and related tools. Missing only minor error handling details.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates fully: it lists all 10 parameters with explanations, defaults, required status, and even cross-refers to sibling tools. Examples in JSON illustrate usage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Run Xcode tests' (verb+resource) and distinguishes itself from siblings like xcodebuild-build (build) and xcodebuild-get-details (get logs). It specifies unit and UI tests.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'Why you'd use it' section lists benefits (smart defaults, metrics, progressive disclosure, filtering) and the 'Related Tools' section provides alternatives. However, it does not explicitly state when not to use this tool (e.g., if only building), though it is implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/conorluddy/xc-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server