Skip to main content
Glama
conorluddy

XC-MCP: XCode CLI wrapper

by conorluddy

Fresh Install (Workflow)

workflow-fresh-install
Destructive

Build, install, and launch an iOS app on a fresh simulator in one call, optionally erasing simulator data for a clean state.

Instructions

workflow-fresh-install

Clean slate app installation - build, install, and launch with fresh simulator state.

Overview

Orchestrates a complete clean installation cycle in a single call:

  1. Select Simulator - Auto-detect or use specified device

  2. Shutdown - Ensure simulator is stopped

  3. Erase (optional) - Wipe all simulator data

  4. Boot - Start fresh simulator

  5. Build - Compile the Xcode project

  6. Install - Install the built app

  7. Launch - Start the app

This workflow keeps intermediate results internal, reducing agent context usage by ~70% compared to calling each tool manually.

Parameters

Required

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

  • scheme (string): Build scheme name

Optional

  • simulatorUdid (string): Target simulator - auto-detected if omitted

  • eraseSimulator (boolean): Wipe simulator data before install (default: false)

  • configuration ("Debug" | "Release"): Build configuration (default: Debug)

  • launchArguments (string[]): App launch arguments

  • environmentVariables (Record<string, string>): App environment variables

Returns

Consolidated result with:

  • success: Overall workflow success

  • project: Build configuration details

  • simulator: Target simulator info

  • app: Installed app details (bundleId, path, launched)

  • totalDuration: Total workflow time

  • guidance: Next steps

Examples

Basic Fresh Install

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

Auto-selects simulator, builds, installs, and launches.

Clean Install with Erased Simulator

{
  "projectPath": "/path/to/MyApp.xcworkspace",
  "scheme": "MyApp",
  "eraseSimulator": true,
  "configuration": "Debug"
}

Erases all simulator data for truly fresh state.

Specific Simulator with Launch Arguments

{
  "projectPath": "/path/to/MyApp.xcodeproj",
  "scheme": "MyApp",
  "simulatorUdid": "ABC123-DEF456",
  "launchArguments": ["-UITesting", "-ResetState"],
  "environmentVariables": {"DEBUG_MODE": "1"}
}

Targets specific simulator with custom launch configuration.

Why Use This Workflow?

Token Efficiency

  • Manual approach: 6-7 tool calls × ~100 tokens each = ~600+ tokens in responses

  • Workflow approach: 1 call with consolidated response = ~150 tokens

Reduced Context Pollution

  • Build logs not exposed (only success/failure)

  • Intermediate states summarized

  • Only actionable outcome returned

Consistent State

  • Shutdown ensures clean starting point

  • Optional erase for truly fresh state

  • Proper boot sequencing

  • workflow-tap-element: UI interaction after install

  • xcodebuild-build: Direct build (used internally)

  • simctl-boot / simctl-shutdown / simctl-erase: Direct simulator control (used internally)

  • simctl-install / simctl-launch: Direct app management (used internally)

Notes

  • Shutdown failures are non-fatal (simulator may already be off)

  • Auto-suggests best simulator based on project requirements

  • Build artifacts are located automatically

  • Bundle ID is discovered from build settings

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
schemeYesBuild scheme name
projectPathYesPath to .xcodeproj or .xcworkspace
configurationNoDebug
simulatorUdidNoTarget simulator
eraseSimulatorNoWipe simulator data
launchArgumentsNo
environmentVariablesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the annotations (which already indicate destructiveness), the description discloses that shutdown failures are non-fatal, erase is optional, intermediate results are internal, and build artifacts/bundle IDs are auto-discovered. This gives the agent a clear model of real-world behavior and edge cases.

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 well-organized with clear headings, an overview, parameter list, examples, and notes. It is somewhat verbose in the 'Why Use This Workflow?' section where token efficiency and context pollution overlap, but for a tool that encapsulates 7 steps, this length is defensible and the key information is front-loaded.

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?

For a complex workflow with 7 parameters and no output schema, the description provides a return structure, examples, edge-case notes, and a full step enumeration. It gives an agent everything necessary to decide on, invoke, and interpret the tool correctly.

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

Parameters3/5

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

Schema coverage is 57%, and the description adds some value: simulatorUdid is noted as auto-detected, defaults are restated, and examples show concrete usage patterns. However, launchArguments and environmentVariables receive no additional semantic explanation beyond their names, leaving part of the parameter space under-specified.

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?

Description opens with 'Clean slate app installation - build, install, and launch with fresh simulator state' and expands into a specific step-by-step orchestration list. It clearly identifies the resource (a full clean install cycle) and distinguishes itself from the many low-level simctl/xcodebuild siblings by emphasizing the consolidated workflow nature.

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

Usage Guidelines3/5

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

The 'Why Use This Workflow?' section argues for token efficiency and consistent state, but it never explicitly states when to choose this over workflow-build-and-run or when to fall back to direct xcodebuild-build/simctl tools. Related tools are listed without usage conditions, leaving the decision partially implied.

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