install_app_device
Installs an app on a physical Apple device like iPhone, iPad, or Apple TV by specifying the device UDID and the .app bundle path. Part of the XcodeBuildMCP server.
Instructions
Installs an app on a physical Apple device (iPhone, iPad, Apple Watch, Apple TV, Apple Vision Pro). Requires deviceId and appPath.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| appPath | Yes | Path to the .app bundle to install (full path to the .app directory) | |
| deviceId | Yes | UDID of the device (obtained from list_devices) |
Implementation Reference
- The main handler function that executes the app installation logic using 'xcrun devicectl device install app' command.export async function install_app_deviceLogic( params: InstallAppDeviceParams, executor: CommandExecutor, ): Promise<ToolResponse> { const { deviceId, appPath } = params; log('info', `Installing app on device ${deviceId}`); try { const result = await executor( ['xcrun', 'devicectl', 'device', 'install', 'app', '--device', deviceId, appPath], 'Install app on device', true, // useShell undefined, // env ); if (!result.success) { return { content: [ { type: 'text', text: `Failed to install app: ${result.error}`, }, ], isError: true, }; } return { content: [ { type: 'text', text: `✅ App installed successfully on device ${deviceId}\n\n${result.output}`, }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); log('error', `Error installing app on device: ${errorMessage}`); return { content: [ { type: 'text', text: `Failed to install app on device: ${errorMessage}`, }, ], isError: true, }; } }
- Zod schema defining the input parameters: deviceId (UDID) and appPath (.app bundle path).const installAppDeviceSchema = z.object({ deviceId: z .string() .min(1, 'Device ID cannot be empty') .describe('UDID of the device (obtained from list_devices)'), appPath: z .string() .describe('Path to the .app bundle to install (full path to the .app directory)'), });
- src/mcp/tools/device/install_app_device.ts:83-93 (registration)Tool registration exporting the MCP tool object with name, description, schema (deviceId omitted for session), and wrapped handler.export default { name: 'install_app_device', description: 'Installs an app on a connected device.', schema: installAppDeviceSchema.omit({ deviceId: true } as const).shape, handler: createSessionAwareTool<InstallAppDeviceParams>({ internalSchema: installAppDeviceSchema as unknown as z.ZodType<InstallAppDeviceParams>, logicFunction: install_app_deviceLogic, getExecutor: getDefaultCommandExecutor, requirements: [{ allOf: ['deviceId'], message: 'deviceId is required' }], }), };