Skip to main content
Glama

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
NameRequiredDescriptionDefault
configurationNoBuild configuration (Debug, Release, etc.)
derivedDataPathNoPath where build products and other derived data will go
extraArgsNoAdditional xcodebuild arguments
preferXcodebuildNoIf true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.
projectPathYesPath to the .xcodeproj file (Required)
schemeYesThe scheme to use (Required)

Implementation Reference

  • 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', ); },
  • 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', ); }, ); }
  • 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', },
  • 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, },
  • 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)');

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/SampsonKY/XcodeBuildMCP'

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