xc-mcp
Version:
MCP server that wraps Xcode command-line tools for iOS/macOS development workflows
39 lines • 4.77 kB
TypeScript
/**
* Workflow: Fresh Install - Clean slate app installation
*
* Orchestrates a complete clean installation cycle:
* 1. simctl-device shutdown → Ensure simulator is stopped
* 2. (optional) simctl-device erase → Wipe simulator data
* 3. simctl-device boot → Start fresh simulator
* 4. xcodebuild-build → Build the project
* 5. simctl-app install → Install the app
* 6. simctl-app launch → Start the app
*
* This workflow keeps intermediate results internal, returning only the final outcome.
* Reduces agent context usage by ~70% compared to calling each tool manually.
*
* Part of the Programmatic Tool Calling pattern from Anthropic:
* https://www.anthropic.com/engineering/advanced-tool-use
*/
export interface FreshInstallArgs {
projectPath: string;
scheme: string;
simulatorUdid?: string;
eraseSimulator?: boolean;
configuration?: 'Debug' | 'Release';
launchArguments?: string[];
environmentVariables?: Record<string, string>;
}
export declare function workflowFreshInstallTool(args: FreshInstallArgs): Promise<{
content: {
type: "text";
text: string;
}[];
isError: boolean;
}>;
/**
* Workflow Fresh Install documentation for RTFM
*/
export declare const WORKFLOW_FRESH_INSTALL_DOCS = "\n# workflow-fresh-install\n\nClean slate app installation - build, install, and launch with fresh simulator state.\n\n## Overview\n\nOrchestrates a complete clean installation cycle in a single call:\n1. **Select Simulator** - Auto-detect or use specified device\n2. **Shutdown** - Ensure simulator is stopped\n3. **Erase** (optional) - Wipe all simulator data\n4. **Boot** - Start fresh simulator\n5. **Build** - Compile the Xcode project\n6. **Install** - Install the built app\n7. **Launch** - Start the app\n\nThis workflow keeps intermediate results internal, reducing agent context usage by ~70% compared to calling each tool manually.\n\n## Parameters\n\n### Required\n- **projectPath** (string): Path to .xcodeproj or .xcworkspace\n- **scheme** (string): Build scheme name\n\n### Optional\n- **simulatorUdid** (string): Target simulator - auto-detected if omitted\n- **eraseSimulator** (boolean): Wipe simulator data before install (default: false)\n- **configuration** (\"Debug\" | \"Release\"): Build configuration (default: Debug)\n- **launchArguments** (string[]): App launch arguments\n- **environmentVariables** (Record<string, string>): App environment variables\n\n## Returns\n\nConsolidated result with:\n- **success**: Overall workflow success\n- **project**: Build configuration details\n- **simulator**: Target simulator info\n- **app**: Installed app details (bundleId, path, launched)\n- **totalDuration**: Total workflow time\n- **guidance**: Next steps\n\n## Examples\n\n### Basic Fresh Install\n```json\n{\n \"projectPath\": \"/path/to/MyApp.xcodeproj\",\n \"scheme\": \"MyApp\"\n}\n```\nAuto-selects simulator, builds, installs, and launches.\n\n### Clean Install with Erased Simulator\n```json\n{\n \"projectPath\": \"/path/to/MyApp.xcworkspace\",\n \"scheme\": \"MyApp\",\n \"eraseSimulator\": true,\n \"configuration\": \"Debug\"\n}\n```\nErases all simulator data for truly fresh state.\n\n### Specific Simulator with Launch Arguments\n```json\n{\n \"projectPath\": \"/path/to/MyApp.xcodeproj\",\n \"scheme\": \"MyApp\",\n \"simulatorUdid\": \"ABC123-DEF456\",\n \"launchArguments\": [\"-UITesting\", \"-ResetState\"],\n \"environmentVariables\": {\"DEBUG_MODE\": \"1\"}\n}\n```\nTargets specific simulator with custom launch configuration.\n\n## Why Use This Workflow?\n\n### Token Efficiency\n- **Manual approach**: 6-7 tool calls \u00D7 ~100 tokens each = ~600+ tokens in responses\n- **Workflow approach**: 1 call with consolidated response = ~150 tokens\n\n### Reduced Context Pollution\n- Build logs not exposed (only success/failure)\n- Intermediate states summarized\n- Only actionable outcome returned\n\n### Consistent State\n- Shutdown ensures clean starting point\n- Optional erase for truly fresh state\n- Proper boot sequencing\n\n## Related Tools\n\n- **workflow-tap-element**: UI interaction after install\n- **xcodebuild-build**: Direct build (used internally)\n- **simctl-device**: Direct simulator control (used internally)\n- **simctl-app**: Direct app management (used internally)\n\n## Notes\n\n- Shutdown failures are non-fatal (simulator may already be off)\n- Auto-suggests best simulator based on project requirements\n- Build artifacts are located automatically\n- Bundle ID is discovered from build settings\n";
export declare const WORKFLOW_FRESH_INSTALL_DOCS_MINI = "Build, install and launch app on fresh simulator. Use rtfm({ toolName: \"workflow-fresh-install\" }) for docs.";
//# sourceMappingURL=fresh-install.d.ts.map