build_ios_sim_id_proj
Compiles an iOS app from a project file for a specific simulator using its UUID. Requires projectPath, scheme, and simulatorId. Handles configurations, derived data paths, and additional xcodebuild arguments for precise builds.
Instructions
Builds an iOS app from a project file for a specific simulator by UUID. IMPORTANT: Requires projectPath, scheme, and simulatorId. Example: build_ios_sim_id_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorId: 'SIMULATOR_UUID' })
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| configuration | No | Build configuration (Debug, Release, etc.) | |
| derivedDataPath | No | Path where build products and other derived data will go | |
| extraArgs | No | Additional xcodebuild arguments | |
| preferXcodebuild | No | If true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails. | |
| projectPath | Yes | Path to the .xcodeproj file (Required) | |
| scheme | Yes | The scheme to use (Required) | |
| simulatorId | Yes | UUID of the simulator to use (obtained from listSimulators) (Required) | |
| useLatestOS | No | Whether to use the latest OS version for the named simulator |
Implementation Reference
- src/tools/build_ios_simulator.ts:511-557 (registration)Specific registration of the 'build_ios_sim_id_proj' tool, including schema, description, and handler function.export function registerIOSSimulatorBuildByIdProjectTool(server: McpServer): void { type Params = { projectPath: string; scheme: string; simulatorId: string; configuration?: string; derivedDataPath?: string; extraArgs?: string[]; useLatestOS?: boolean; preferXcodebuild?: boolean; }; registerTool<Params>( server, 'build_ios_sim_id_proj', "Builds an iOS app from a project file for a specific simulator by UUID. IMPORTANT: Requires projectPath, scheme, and simulatorId. Example: build_ios_sim_id_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme', simulatorId: 'SIMULATOR_UUID' })", { projectPath: projectPathSchema, scheme: schemeSchema, simulatorId: simulatorIdSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, extraArgs: extraArgsSchema, useLatestOS: useLatestOSSchema, preferXcodebuild: preferXcodebuildSchema, }, async (params: Params) => { // Validate required parameters const projectValidation = validateRequiredParam('projectPath', params.projectPath); if (!projectValidation.isValid) return projectValidation.errorResponse!; const schemeValidation = validateRequiredParam('scheme', params.scheme); if (!schemeValidation.isValid) return schemeValidation.errorResponse!; const simulatorIdValidation = validateRequiredParam('simulatorId', params.simulatorId); if (!simulatorIdValidation.isValid) return simulatorIdValidation.errorResponse!; // Provide defaults return _handleIOSSimulatorBuildLogic({ ...params, configuration: params.configuration ?? 'Debug', useLatestOS: params.useLatestOS ?? true, // May be ignored by xcodebuild preferXcodebuild: params.preferXcodebuild ?? false, }); }, ); }
- src/tools/build_ios_simulator.ts:42-70 (handler)Core internal handler logic for iOS simulator builds, invoked by the tool handler. Calls executeXcodeBuildCommand to perform the actual xcodebuild.async function _handleIOSSimulatorBuildLogic(params: { workspacePath?: string; projectPath?: string; scheme: string; configuration: string; simulatorName?: string; simulatorId?: string; useLatestOS: boolean; derivedDataPath?: string; extraArgs?: string[]; preferXcodebuild?: boolean; }): Promise<ToolResponse> { log('info', `Starting iOS Simulator build for scheme ${params.scheme} (internal)`); return executeXcodeBuildCommand( { ...params, }, { platform: XcodePlatform.iOSSimulator, simulatorName: params.simulatorName, simulatorId: params.simulatorId, useLatestOS: params.useLatestOS, logPrefix: 'iOS Simulator Build', }, params.preferXcodebuild, 'build', ); }
- Input schema definition for the tool parameters.{ projectPath: projectPathSchema, scheme: schemeSchema, simulatorId: simulatorIdSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, extraArgs: extraArgsSchema, useLatestOS: useLatestOSSchema, preferXcodebuild: preferXcodebuildSchema, },
- src/utils/register-tools.ts:231-235 (registration)Top-level inclusion of the tool registration function in the main tools registry list, enabling conditional registration.{ register: registerIOSSimulatorBuildByIdProjectTool, groups: [ToolGroup.IOS_SIMULATOR_WORKFLOW], envVar: 'XCODEBUILDMCP_TOOL_IOS_SIMULATOR_BUILD_BY_ID_PROJECT', },