build_ios_dev_proj
Build iOS apps for physical devices by specifying project path and scheme. Supports configurations, custom data paths, and additional xcodebuild arguments.
Instructions
Builds an iOS app from a project file for a physical device. IMPORTANT: Requires projectPath and scheme. Example: build_ios_dev_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })
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) |
Implementation Reference
- src/tools/build_ios_device.ts:90-109 (handler)The core handler function for the 'build_ios_dev_proj' tool. Validates required 'projectPath' and 'scheme' parameters, sets default configuration to 'Debug' if not provided, and executes the xcodebuild build command for iOS device targeting.async (params: Params) => { const projectValidation = validateRequiredParam('projectPath', params.projectPath); if (!projectValidation.isValid) return projectValidation.errorResponse!; const schemeValidation = validateRequiredParam('scheme', params.scheme); if (!schemeValidation.isValid) return schemeValidation.errorResponse!; return executeXcodeBuildCommand( { ...params, configuration: params.configuration ?? 'Debug', // Default config }, { platform: XcodePlatform.iOS, logPrefix: 'iOS Device Build', }, params.preferXcodebuild, 'build', ); },
- src/tools/build_ios_device.ts:76-111 (registration)Specific registration function for the 'build_ios_dev_proj' tool, defining its name, description, input schema, and handler.export function registerIOSDeviceBuildProjectTool(server: McpServer): void { type Params = BaseProjectParams; registerTool<Params>( server, 'build_ios_dev_proj', "Builds an iOS app from a project file for a physical device. IMPORTANT: Requires projectPath and scheme. Example: build_ios_dev_proj({ projectPath: '/path/to/MyProject.xcodeproj', scheme: 'MyScheme' })", { projectPath: projectPathSchema, scheme: schemeSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, extraArgs: extraArgsSchema, preferXcodebuild: preferXcodebuildSchema, }, async (params: Params) => { const projectValidation = validateRequiredParam('projectPath', params.projectPath); if (!projectValidation.isValid) return projectValidation.errorResponse!; const schemeValidation = validateRequiredParam('scheme', params.scheme); if (!schemeValidation.isValid) return schemeValidation.errorResponse!; return executeXcodeBuildCommand( { ...params, configuration: params.configuration ?? 'Debug', // Default config }, { platform: XcodePlatform.iOS, logPrefix: 'iOS Device Build', }, params.preferXcodebuild, 'build', ); }, ); }
- src/utils/register-tools.ts:258-262 (registration)Top-level registration entry that invokes registerIOSDeviceBuildTools (which registers both workspace and project variants, including 'build_ios_dev_proj') as part of the centralized tool registration system.{ register: registerIOSDeviceBuildTools, groups: [ToolGroup.IOS_DEVICE_WORKFLOW], envVar: 'XCODEBUILDMCP_TOOL_IOS_DEVICE_BUILD_TOOLS', },
- src/tools/build_ios_device.ts:82-89 (schema)Input schema definition for the tool parameters, referencing shared Zod schemas from common.ts.{ projectPath: projectPathSchema, scheme: schemeSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, extraArgs: extraArgsSchema, preferXcodebuild: preferXcodebuildSchema, },
- src/tools/common.ts:22-23 (helper)Shared Zod schema definitions for key parameters used in the tool's input schema (projectPathSchema, schemeSchema, etc.).export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)'); export const projectPathSchema = z.string().describe('Path to the .xcodeproj file (Required)');