Skip to main content
Glama

build_ios_sim_name_ws

Build an iOS app from a workspace for a specific simulator by name. Requires workspace path, scheme, and simulator name to compile and run iOS applications in designated simulators.

Instructions

Builds an iOS app from a workspace for a specific simulator by name. IMPORTANT: Requires workspacePath, scheme, and simulatorName. Example: build_ios_sim_name_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme', simulatorName: 'iPhone 16' })

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
workspacePathYesPath to the .xcworkspace file (Required)
schemeYesThe scheme to use (Required)
simulatorNameYesName of the simulator to use (e.g., 'iPhone 16') (Required)
configurationNoBuild configuration (Debug, Release, etc.)
derivedDataPathNoPath where build products and other derived data will go
extraArgsNoAdditional xcodebuild arguments
useLatestOSNoWhether to use the latest OS version for the named simulator
preferXcodebuildNoIf true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.

Implementation Reference

  • Core handler function that executes the iOS simulator build using xcodebuild, called by the tool's registration handler.
    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', ); }
  • Registration function that defines and registers the 'build_ios_sim_name_ws' tool with MCP server, including input schema, description, and thin handler wrapper.
    export function registerIOSSimulatorBuildByNameWorkspaceTool(server: McpServer): void { type Params = { workspacePath: string; scheme: string; simulatorName: string; configuration?: string; derivedDataPath?: string; extraArgs?: string[]; useLatestOS?: boolean; preferXcodebuild?: boolean; }; registerTool<Params>( server, 'build_ios_sim_name_ws', "Builds an iOS app from a workspace for a specific simulator by name. IMPORTANT: Requires workspacePath, scheme, and simulatorName. Example: build_ios_sim_name_ws({ workspacePath: '/path/to/MyProject.xcworkspace', scheme: 'MyScheme', simulatorName: 'iPhone 16' })", { workspacePath: workspacePathSchema, scheme: schemeSchema, simulatorName: simulatorNameSchema, configuration: configurationSchema, derivedDataPath: derivedDataPathSchema, extraArgs: extraArgsSchema, useLatestOS: useLatestOSSchema, preferXcodebuild: preferXcodebuildSchema, }, async (params: Params) => { // Validate required parameters const workspaceValidation = validateRequiredParam('workspacePath', params.workspacePath); if (!workspaceValidation.isValid) return workspaceValidation.errorResponse!; const schemeValidation = validateRequiredParam('scheme', params.scheme); if (!schemeValidation.isValid) return schemeValidation.errorResponse!; const simulatorNameValidation = validateRequiredParam('simulatorName', params.simulatorName); if (!simulatorNameValidation.isValid) return simulatorNameValidation.errorResponse!; // Provide defaults return _handleIOSSimulatorBuildLogic({ ...params, configuration: params.configuration ?? 'Debug', useLatestOS: params.useLatestOS ?? true, preferXcodebuild: params.preferXcodebuild ?? false, }); }, ); }
  • Zod schemas for common tool parameters, used in the input schema for 'build_ios_sim_name_ws'.
    export const workspacePathSchema = z.string().describe('Path to the .xcworkspace file (Required)'); export const projectPathSchema = z.string().describe('Path to the .xcodeproj file (Required)'); export const schemeSchema = z.string().describe('The scheme to use (Required)'); export const configurationSchema = z .string() .optional() .describe('Build configuration (Debug, Release, etc.)'); export const derivedDataPathSchema = z .string() .optional() .describe('Path where build products and other derived data will go'); export const extraArgsSchema = z .array(z.string()) .optional() .describe('Additional xcodebuild arguments'); export const simulatorNameSchema = z .string() .describe("Name of the simulator to use (e.g., 'iPhone 16') (Required)"); export const simulatorIdSchema = z .string() .describe('UUID of the simulator to use (obtained from listSimulators) (Required)'); export const useLatestOSSchema = z .boolean() .optional() .describe('Whether to use the latest OS version for the named simulator'); export const appPathSchema = z .string() .describe('Path to the .app bundle (full path to the .app directory)'); export const bundleIdSchema = z .string() .describe("Bundle identifier of the app (e.g., 'com.example.MyApp')"); export const launchArgsSchema = z .array(z.string()) .optional() .describe('Additional arguments to pass to the app'); export const preferXcodebuildSchema = z .boolean() .optional() .describe( 'If true, prefers xcodebuild over the experimental incremental build system, useful for when incremental build system fails.', );
  • Invocation of the tool registration function in the central tool registration array.
    register: registerIOSSimulatorBuildByNameWorkspaceTool, groups: [ToolGroup.IOS_SIMULATOR_WORKFLOW], envVar: 'XCODEBUILDMCP_TOOL_IOS_SIMULATOR_BUILD_BY_NAME_WORKSPACE', },

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