From 79b4b7caee4a3bade9dee4acfb178344226abc5f Mon Sep 17 00:00:00 2001 From: bitxeno <137328844+bitxeno@users.noreply.github.com> Date: Wed, 22 Apr 2026 14:54:51 +0800 Subject: [PATCH 1/2] feat(device): add multiple platform support for device build --- src/mcp/tools/device/build_device.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mcp/tools/device/build_device.ts b/src/mcp/tools/device/build_device.ts index 2a5e4095..f5787f61 100644 --- a/src/mcp/tools/device/build_device.ts +++ b/src/mcp/tools/device/build_device.ts @@ -46,11 +46,11 @@ const baseSchemaObject = z.object({ projectPath: z.string().optional().describe('Path to the .xcodeproj file'), workspacePath: z.string().optional().describe('Path to the .xcworkspace file'), scheme: z.string().describe('The scheme to build'), + platform: devicePlatformSchema, configuration: z.string().optional().describe('Build configuration (Debug, Release)'), derivedDataPath: z.string().optional(), extraArgs: z.array(z.string()).optional(), preferXcodebuild: z.boolean().optional(), - platform: devicePlatformSchema, }); const buildDeviceSchema = z.preprocess( @@ -128,6 +128,9 @@ export async function buildDeviceLogic( ...(params.derivedDataPath !== undefined ? { derivedDataPath: params.derivedDataPath } : {}), + ...(params.platform !== undefined + ? { platform: String(mapDevicePlatform(params.platform)) } + : {}), }, }; } From 5a5992bc7d3252d5d930a5f6fd92652c6e013871 Mon Sep 17 00:00:00 2001 From: Cameron Cooke Date: Sat, 25 Apr 2026 23:24:07 +0100 Subject: [PATCH 2/2] test(device): cover non-iOS platform build_device path Adds a watchOS test verifying that the build command targets generic/platform=watchOS, the log prefix reflects the platform, and get_device_app_path next-step params include the resolved platform. --- .../device/__tests__/build_device.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/mcp/tools/device/__tests__/build_device.test.ts b/src/mcp/tools/device/__tests__/build_device.test.ts index 7ac5812b..4e4d0175 100644 --- a/src/mcp/tools/device/__tests__/build_device.test.ts +++ b/src/mcp/tools/device/__tests__/build_device.test.ts @@ -346,5 +346,32 @@ describe('build_device plugin', () => { ]); expect(spy.commandCalls[0].logPrefix).toBe('iOS Device Build'); }); + + it('should target watchOS platform when platform=watchOS is provided', async () => { + const spy = createSpyExecutor(); + + const { result } = await runToolLogic(() => + buildDeviceLogic( + { + projectPath: '/path/to/MyWatchApp.xcodeproj', + scheme: 'MyWatchApp', + platform: 'watchOS', + }, + spy.executor, + ), + ); + + expect(spy.commandCalls).toHaveLength(1); + const args = spy.commandCalls[0].args; + const destinationIndex = args.indexOf('-destination'); + expect(destinationIndex).toBeGreaterThan(-1); + expect(args[destinationIndex + 1]).toBe('generic/platform=watchOS'); + expect(spy.commandCalls[0].logPrefix).toBe('watchOS Device Build'); + expect(result.nextStepParams).toEqual( + expect.objectContaining({ + get_device_app_path: expect.objectContaining({ platform: 'watchOS' }), + }), + ); + }); }); });