@ebowwa/mcp-ios-devices 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/build.d.ts +2 -0
- package/dist/tools/build.d.ts.map +1 -0
- package/dist/tools/build.js +281 -0
- package/dist/tools/build.js.map +1 -0
- package/package.json +2 -2
- package/src/index.ts +1 -0
- package/src/tools/build.ts +298 -0
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAgBH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAgBH,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kBAAkB;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,oEAAoE;AACpE,OAAO,mBAAmB,CAAC;AAC3B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,gBAAgB,CAAC;AACxB,OAAO,gBAAgB,CAAC;AACxB,OAAO,iBAAiB,CAAC;AACzB,OAAO,sBAAsB,CAAC;AAC9B,OAAO,mBAAmB,CAAC;AAC3B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,SAAS,EACT,QAAQ,GACT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kBAAkB;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,oEAAoE;AACpE,OAAO,mBAAmB,CA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,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../src/tools/build.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build, Test & Debug Tools
|
|
3
|
+
* Xcode build, test, debug, and performance profiling operations
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { registerTool } from '../registry.js';
|
|
7
|
+
import { xcodeTools } from '@ebowwa/ios-devices';
|
|
8
|
+
// ============================================================================
|
|
9
|
+
// Build Tools
|
|
10
|
+
// ============================================================================
|
|
11
|
+
registerTool({
|
|
12
|
+
name: 'ios_build_app',
|
|
13
|
+
description: `Build an iOS app using xcodebuild.
|
|
14
|
+
|
|
15
|
+
Supports building for device or simulator. Returns build status, warnings, errors, and app path.
|
|
16
|
+
|
|
17
|
+
Examples:
|
|
18
|
+
- Build for simulator: { scheme: "MyApp", destination: "platform=iOS Simulator,name=iPhone 15" }
|
|
19
|
+
- Build for device: { scheme: "MyApp", destination: "platform=iOS,name=Starlink" }
|
|
20
|
+
- Build with workspace: { workspace: "MyApp.xcworkspace", scheme: "MyApp" }`,
|
|
21
|
+
inputSchema: z.object({
|
|
22
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
23
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
24
|
+
scheme: z.string().describe('Build scheme name'),
|
|
25
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Debug'),
|
|
26
|
+
destination: z.string().optional().describe('Build destination (e.g., "platform=iOS,name=Starlink")'),
|
|
27
|
+
sdk: z.string().optional().describe('SDK to use (e.g., "iphoneos", "iphonesimulator")'),
|
|
28
|
+
derivedDataPath: z.string().optional().describe('Path for derived data'),
|
|
29
|
+
codeSignIdentity: z.string().optional().describe('Code signing identity'),
|
|
30
|
+
provisioningProfile: z.string().optional().describe('Provisioning profile UUID'),
|
|
31
|
+
extraArgs: z.array(z.string()).optional().describe('Additional xcodebuild arguments'),
|
|
32
|
+
}),
|
|
33
|
+
handler: async (options) => {
|
|
34
|
+
return xcodeTools.buildApp(options);
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
registerTool({
|
|
38
|
+
name: 'ios_archive_app',
|
|
39
|
+
description: `Archive an iOS app for distribution.
|
|
40
|
+
|
|
41
|
+
Creates an .xcarchive that can be exported to IPA.
|
|
42
|
+
|
|
43
|
+
Examples:
|
|
44
|
+
- Archive for release: { scheme: "MyApp", archivePath: "/tmp/MyApp.xcarchive", configuration: "Release" }`,
|
|
45
|
+
inputSchema: z.object({
|
|
46
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
47
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
48
|
+
scheme: z.string().describe('Build scheme name'),
|
|
49
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Release'),
|
|
50
|
+
archivePath: z.string().describe('Path for the .xcarchive'),
|
|
51
|
+
destination: z.string().optional().describe('Build destination'),
|
|
52
|
+
}),
|
|
53
|
+
handler: async (options) => {
|
|
54
|
+
return xcodeTools.archiveApp(options);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
registerTool({
|
|
58
|
+
name: 'ios_export_ipa',
|
|
59
|
+
description: `Export IPA from archive for distribution.
|
|
60
|
+
|
|
61
|
+
Requires an export options plist for code signing configuration.
|
|
62
|
+
|
|
63
|
+
Examples:
|
|
64
|
+
- Export for App Store: { archivePath: "/tmp/MyApp.xcarchive", exportPath: "/tmp/export", exportOptionsPlist: "/tmp/ExportOptions.plist" }`,
|
|
65
|
+
inputSchema: z.object({
|
|
66
|
+
archivePath: z.string().describe('Path to .xcarchive'),
|
|
67
|
+
exportPath: z.string().describe('Directory for exported IPA'),
|
|
68
|
+
exportOptionsPlist: z.string().describe('Path to ExportOptions.plist'),
|
|
69
|
+
}),
|
|
70
|
+
handler: async (options) => {
|
|
71
|
+
return xcodeTools.exportIPA(options);
|
|
72
|
+
},
|
|
73
|
+
});
|
|
74
|
+
// ============================================================================
|
|
75
|
+
// Test Tools
|
|
76
|
+
// ============================================================================
|
|
77
|
+
registerTool({
|
|
78
|
+
name: 'ios_run_tests',
|
|
79
|
+
description: `Run unit/UI tests using xcodebuild test.
|
|
80
|
+
|
|
81
|
+
Returns test results with pass/fail counts and individual test outcomes.
|
|
82
|
+
|
|
83
|
+
Examples:
|
|
84
|
+
- Run all tests: { scheme: "MyAppTests", destination: "platform=iOS Simulator,name=iPhone 15" }
|
|
85
|
+
- Run specific test: { scheme: "MyAppTests", onlyTesting: ["MyAppTests/MyTestClass/testMethod"] }
|
|
86
|
+
- Run test plan: { scheme: "MyApp", testPlan: "AllTests" }`,
|
|
87
|
+
inputSchema: z.object({
|
|
88
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
89
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
90
|
+
scheme: z.string().describe('Test scheme name'),
|
|
91
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Debug'),
|
|
92
|
+
destination: z.string().optional().describe('Test destination (device or simulator)'),
|
|
93
|
+
testPlan: z.string().optional().describe('Test plan name'),
|
|
94
|
+
onlyTesting: z.array(z.string()).optional().describe('Specific tests to run (e.g., ["TestClass/testMethod"])'),
|
|
95
|
+
skipTesting: z.array(z.string()).optional().describe('Tests to skip'),
|
|
96
|
+
parallelTesting: z.boolean().optional().default(false).describe('Enable parallel testing'),
|
|
97
|
+
retryCount: z.number().optional().describe('Number of times to retry failed tests'),
|
|
98
|
+
}),
|
|
99
|
+
handler: async (options) => {
|
|
100
|
+
return xcodeTools.runTests(options);
|
|
101
|
+
},
|
|
102
|
+
});
|
|
103
|
+
// ============================================================================
|
|
104
|
+
// Debug Tools
|
|
105
|
+
// ============================================================================
|
|
106
|
+
registerTool({
|
|
107
|
+
name: 'ios_debug_app',
|
|
108
|
+
description: `Start debugging an app on device using lldb.
|
|
109
|
+
|
|
110
|
+
Launches the app and attaches the debugger. Use for debugging crashes, breakpoints, etc.
|
|
111
|
+
|
|
112
|
+
Examples:
|
|
113
|
+
- Debug app: { deviceId: "00008030-00146...", bundleId: "com.myapp.ios" }
|
|
114
|
+
- Wait for debugger: { deviceId: "...", bundleId: "com.myapp.ios", waitForDebugger: true }
|
|
115
|
+
- With environment: { deviceId: "...", bundleId: "com.myapp.ios", environment: { "DEBUG": "1" } }`,
|
|
116
|
+
inputSchema: z.object({
|
|
117
|
+
deviceId: z.string().describe('Device UDID'),
|
|
118
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
119
|
+
waitForDebugger: z.boolean().optional().default(false).describe('Wait for debugger to attach before launching'),
|
|
120
|
+
environment: z.record(z.string()).optional().describe('Environment variables to set'),
|
|
121
|
+
arguments: z.array(z.string()).optional().describe('Command line arguments'),
|
|
122
|
+
}),
|
|
123
|
+
handler: async (options) => {
|
|
124
|
+
return xcodeTools.startDebugServer(options);
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
registerTool({
|
|
128
|
+
name: 'ios_attach_debugger',
|
|
129
|
+
description: `Attach debugger to a running process.
|
|
130
|
+
|
|
131
|
+
Attaches lldb to an already running app for debugging.
|
|
132
|
+
|
|
133
|
+
Examples:
|
|
134
|
+
- Attach by bundle ID: { deviceId: "...", bundleId: "com.myapp.ios" }
|
|
135
|
+
- Attach by PID: { deviceId: "...", bundleId: "com.myapp.ios", pid: 12345 }`,
|
|
136
|
+
inputSchema: z.object({
|
|
137
|
+
deviceId: z.string().describe('Device UDID'),
|
|
138
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
139
|
+
pid: z.number().optional().describe('Process ID (optional, uses bundle ID if omitted)'),
|
|
140
|
+
}),
|
|
141
|
+
handler: async (options) => {
|
|
142
|
+
return xcodeTools.attachToProcess(options);
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
// ============================================================================
|
|
146
|
+
// App Console (Filtered Logs)
|
|
147
|
+
// ============================================================================
|
|
148
|
+
registerTool({
|
|
149
|
+
name: 'ios_app_console',
|
|
150
|
+
description: `Stream console logs for a specific app.
|
|
151
|
+
|
|
152
|
+
Filters device logs to show only messages from the specified app. Useful for debugging app behavior.
|
|
153
|
+
|
|
154
|
+
Examples:
|
|
155
|
+
- Stream app logs for 30s: { deviceId: "...", bundleId: "com.myapp.ios" }
|
|
156
|
+
- Extended logging: { deviceId: "...", bundleId: "com.myapp.ios", timeoutSeconds: 60, maxLines: 2000 }`,
|
|
157
|
+
inputSchema: z.object({
|
|
158
|
+
deviceId: z.string().describe('Device UDID'),
|
|
159
|
+
bundleId: z.string().describe('App bundle identifier to filter logs'),
|
|
160
|
+
timeoutSeconds: z.number().min(5).max(300).default(30).describe('How long to collect logs'),
|
|
161
|
+
maxLines: z.number().min(10).max(5000).default(500).optional().describe('Maximum log lines'),
|
|
162
|
+
includeSystem: z.boolean().optional().default(false).describe('Include system logs (not just app)'),
|
|
163
|
+
}),
|
|
164
|
+
handler: async ({ deviceId, bundleId, timeoutSeconds, maxLines, includeSystem }) => {
|
|
165
|
+
const result = await xcodeTools.streamAppConsole({
|
|
166
|
+
deviceId,
|
|
167
|
+
bundleId,
|
|
168
|
+
timeoutMs: timeoutSeconds * 1000,
|
|
169
|
+
maxLines,
|
|
170
|
+
includeSystem,
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
logCount: result.logs.length,
|
|
174
|
+
truncated: result.truncated,
|
|
175
|
+
logs: result.logs,
|
|
176
|
+
bundleId,
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
});
|
|
180
|
+
// ============================================================================
|
|
181
|
+
// Performance Profiling (Instruments)
|
|
182
|
+
// ============================================================================
|
|
183
|
+
registerTool({
|
|
184
|
+
name: 'ios_list_instruments_templates',
|
|
185
|
+
description: `List available Instruments templates for profiling.
|
|
186
|
+
|
|
187
|
+
Returns all available profiling templates like Time Profiler, Allocations, Leaks, etc.
|
|
188
|
+
|
|
189
|
+
Example:
|
|
190
|
+
- List templates: {}`,
|
|
191
|
+
inputSchema: z.object({}),
|
|
192
|
+
handler: async () => {
|
|
193
|
+
return xcodeTools.listInstrumentsTemplates();
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
registerTool({
|
|
197
|
+
name: 'ios_run_instruments',
|
|
198
|
+
description: `Run Instruments profiling on device.
|
|
199
|
+
|
|
200
|
+
Profiles app performance using the specified template. Results saved to trace file.
|
|
201
|
+
|
|
202
|
+
Examples:
|
|
203
|
+
- Time profile: { deviceId: "...", bundleId: "com.myapp.ios", template: "Time Profiler", outputPath: "/tmp/trace.trace" }
|
|
204
|
+
- Memory profile: { deviceId: "...", bundleId: "com.myapp.ios", template: "Allocations", outputPath: "/tmp/alloc.trace" }
|
|
205
|
+
- Leaks check: { deviceId: "...", bundleId: "com.myapp.ios", template: "Leaks", outputPath: "/tmp/leaks.trace" }`,
|
|
206
|
+
inputSchema: z.object({
|
|
207
|
+
deviceId: z.string().describe('Device UDID'),
|
|
208
|
+
template: z.string().describe('Instruments template name (e.g., "Time Profiler", "Allocations", "Leaks")'),
|
|
209
|
+
bundleId: z.string().optional().describe('App bundle identifier'),
|
|
210
|
+
appPath: z.string().optional().describe('Path to .app bundle'),
|
|
211
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
212
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
213
|
+
extraArgs: z.array(z.string()).optional().describe('Additional instruments arguments'),
|
|
214
|
+
}),
|
|
215
|
+
handler: async (options) => {
|
|
216
|
+
return xcodeTools.runInstruments({
|
|
217
|
+
deviceId: options.deviceId,
|
|
218
|
+
template: options.template,
|
|
219
|
+
bundleId: options.bundleId,
|
|
220
|
+
appPath: options.appPath,
|
|
221
|
+
outputPath: options.outputPath,
|
|
222
|
+
duration: options.duration,
|
|
223
|
+
extraArgs: options.extraArgs,
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
registerTool({
|
|
228
|
+
name: 'ios_profile_time',
|
|
229
|
+
description: `Run Time Profiler on app.
|
|
230
|
+
|
|
231
|
+
Profiles CPU usage to identify performance bottlenecks.
|
|
232
|
+
|
|
233
|
+
Examples:
|
|
234
|
+
- Profile for 60s: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/time-profile.trace" }`,
|
|
235
|
+
inputSchema: z.object({
|
|
236
|
+
deviceId: z.string().describe('Device UDID'),
|
|
237
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
238
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
239
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
240
|
+
}),
|
|
241
|
+
handler: async (options) => {
|
|
242
|
+
return xcodeTools.runTimeProfiler(options);
|
|
243
|
+
},
|
|
244
|
+
});
|
|
245
|
+
registerTool({
|
|
246
|
+
name: 'ios_profile_memory',
|
|
247
|
+
description: `Run Allocations profiler on app.
|
|
248
|
+
|
|
249
|
+
Tracks memory allocations to identify memory usage patterns.
|
|
250
|
+
|
|
251
|
+
Examples:
|
|
252
|
+
- Profile memory: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/allocations.trace" }`,
|
|
253
|
+
inputSchema: z.object({
|
|
254
|
+
deviceId: z.string().describe('Device UDID'),
|
|
255
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
256
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
257
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
258
|
+
}),
|
|
259
|
+
handler: async (options) => {
|
|
260
|
+
return xcodeTools.runAllocationsProfiler(options);
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
registerTool({
|
|
264
|
+
name: 'ios_profile_leaks',
|
|
265
|
+
description: `Run Leaks profiler on app.
|
|
266
|
+
|
|
267
|
+
Detects memory leaks in the application.
|
|
268
|
+
|
|
269
|
+
Examples:
|
|
270
|
+
- Check for leaks: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/leaks.trace" }`,
|
|
271
|
+
inputSchema: z.object({
|
|
272
|
+
deviceId: z.string().describe('Device UDID'),
|
|
273
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
274
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
275
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
276
|
+
}),
|
|
277
|
+
handler: async (options) => {
|
|
278
|
+
return xcodeTools.runLeaksProfiler(options);
|
|
279
|
+
},
|
|
280
|
+
});
|
|
281
|
+
//# sourceMappingURL=build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/tools/build.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAA+B,MAAM,qBAAqB,CAAC;AAE9E,+EAA+E;AAC/E,cAAc;AACd,+EAA+E;AAE/E,YAAY,CAAC;IACX,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE;;;;;;;4EAO6D;IAC1E,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAClE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;QACtE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;QAChD,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;QACvE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,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U,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEH,YAAY,CAAC;IACX,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE;;;;;kGAKmF;IAChG,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC;QAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACtD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6BAA6B,CAAC;QAC9D,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,+BAA+B,CAAC;KACtF,CAAC;IACF,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;QACzB,OAAO,UAAU,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAC9C,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ebowwa/mcp-ios-devices",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "MCP server for iOS device control - devicectl, libimobiledevice, simctl",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@anthropic-ai/sdk": "^0.39.0",
|
|
34
|
-
"@ebowwa/ios-devices": "^1.0
|
|
34
|
+
"@ebowwa/ios-devices": "^1.1.0",
|
|
35
35
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
36
36
|
"zod": "^3.22.0"
|
|
37
37
|
},
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build, Test & Debug Tools
|
|
3
|
+
* Xcode build, test, debug, and performance profiling operations
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { registerTool } from '../registry.js';
|
|
7
|
+
import { xcodeTools, LibIMobileDevice, DeviceCtl } from '@ebowwa/ios-devices';
|
|
8
|
+
|
|
9
|
+
// ============================================================================
|
|
10
|
+
// Build Tools
|
|
11
|
+
// ============================================================================
|
|
12
|
+
|
|
13
|
+
registerTool({
|
|
14
|
+
name: 'ios_build_app',
|
|
15
|
+
description: `Build an iOS app using xcodebuild.
|
|
16
|
+
|
|
17
|
+
Supports building for device or simulator. Returns build status, warnings, errors, and app path.
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
- Build for simulator: { scheme: "MyApp", destination: "platform=iOS Simulator,name=iPhone 15" }
|
|
21
|
+
- Build for device: { scheme: "MyApp", destination: "platform=iOS,name=Starlink" }
|
|
22
|
+
- Build with workspace: { workspace: "MyApp.xcworkspace", scheme: "MyApp" }`,
|
|
23
|
+
inputSchema: z.object({
|
|
24
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
25
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
26
|
+
scheme: z.string().describe('Build scheme name'),
|
|
27
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Debug'),
|
|
28
|
+
destination: z.string().optional().describe('Build destination (e.g., "platform=iOS,name=Starlink")'),
|
|
29
|
+
sdk: z.string().optional().describe('SDK to use (e.g., "iphoneos", "iphonesimulator")'),
|
|
30
|
+
derivedDataPath: z.string().optional().describe('Path for derived data'),
|
|
31
|
+
codeSignIdentity: z.string().optional().describe('Code signing identity'),
|
|
32
|
+
provisioningProfile: z.string().optional().describe('Provisioning profile UUID'),
|
|
33
|
+
extraArgs: z.array(z.string()).optional().describe('Additional xcodebuild arguments'),
|
|
34
|
+
}),
|
|
35
|
+
handler: async (options) => {
|
|
36
|
+
return xcodeTools.buildApp(options);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
registerTool({
|
|
41
|
+
name: 'ios_archive_app',
|
|
42
|
+
description: `Archive an iOS app for distribution.
|
|
43
|
+
|
|
44
|
+
Creates an .xcarchive that can be exported to IPA.
|
|
45
|
+
|
|
46
|
+
Examples:
|
|
47
|
+
- Archive for release: { scheme: "MyApp", archivePath: "/tmp/MyApp.xcarchive", configuration: "Release" }`,
|
|
48
|
+
inputSchema: z.object({
|
|
49
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
50
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
51
|
+
scheme: z.string().describe('Build scheme name'),
|
|
52
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Release'),
|
|
53
|
+
archivePath: z.string().describe('Path for the .xcarchive'),
|
|
54
|
+
destination: z.string().optional().describe('Build destination'),
|
|
55
|
+
}),
|
|
56
|
+
handler: async (options) => {
|
|
57
|
+
return xcodeTools.archiveApp(options);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
registerTool({
|
|
62
|
+
name: 'ios_export_ipa',
|
|
63
|
+
description: `Export IPA from archive for distribution.
|
|
64
|
+
|
|
65
|
+
Requires an export options plist for code signing configuration.
|
|
66
|
+
|
|
67
|
+
Examples:
|
|
68
|
+
- Export for App Store: { archivePath: "/tmp/MyApp.xcarchive", exportPath: "/tmp/export", exportOptionsPlist: "/tmp/ExportOptions.plist" }`,
|
|
69
|
+
inputSchema: z.object({
|
|
70
|
+
archivePath: z.string().describe('Path to .xcarchive'),
|
|
71
|
+
exportPath: z.string().describe('Directory for exported IPA'),
|
|
72
|
+
exportOptionsPlist: z.string().describe('Path to ExportOptions.plist'),
|
|
73
|
+
}),
|
|
74
|
+
handler: async (options) => {
|
|
75
|
+
return xcodeTools.exportIPA(options);
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// ============================================================================
|
|
80
|
+
// Test Tools
|
|
81
|
+
// ============================================================================
|
|
82
|
+
|
|
83
|
+
registerTool({
|
|
84
|
+
name: 'ios_run_tests',
|
|
85
|
+
description: `Run unit/UI tests using xcodebuild test.
|
|
86
|
+
|
|
87
|
+
Returns test results with pass/fail counts and individual test outcomes.
|
|
88
|
+
|
|
89
|
+
Examples:
|
|
90
|
+
- Run all tests: { scheme: "MyAppTests", destination: "platform=iOS Simulator,name=iPhone 15" }
|
|
91
|
+
- Run specific test: { scheme: "MyAppTests", onlyTesting: ["MyAppTests/MyTestClass/testMethod"] }
|
|
92
|
+
- Run test plan: { scheme: "MyApp", testPlan: "AllTests" }`,
|
|
93
|
+
inputSchema: z.object({
|
|
94
|
+
project: z.string().optional().describe('Path to .xcodeproj file'),
|
|
95
|
+
workspace: z.string().optional().describe('Path to .xcworkspace file'),
|
|
96
|
+
scheme: z.string().describe('Test scheme name'),
|
|
97
|
+
configuration: z.enum(['Debug', 'Release']).optional().default('Debug'),
|
|
98
|
+
destination: z.string().optional().describe('Test destination (device or simulator)'),
|
|
99
|
+
testPlan: z.string().optional().describe('Test plan name'),
|
|
100
|
+
onlyTesting: z.array(z.string()).optional().describe('Specific tests to run (e.g., ["TestClass/testMethod"])'),
|
|
101
|
+
skipTesting: z.array(z.string()).optional().describe('Tests to skip'),
|
|
102
|
+
parallelTesting: z.boolean().optional().default(false).describe('Enable parallel testing'),
|
|
103
|
+
retryCount: z.number().optional().describe('Number of times to retry failed tests'),
|
|
104
|
+
}),
|
|
105
|
+
handler: async (options) => {
|
|
106
|
+
return xcodeTools.runTests(options);
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// ============================================================================
|
|
111
|
+
// Debug Tools
|
|
112
|
+
// ============================================================================
|
|
113
|
+
|
|
114
|
+
registerTool({
|
|
115
|
+
name: 'ios_debug_app',
|
|
116
|
+
description: `Start debugging an app on device using lldb.
|
|
117
|
+
|
|
118
|
+
Launches the app and attaches the debugger. Use for debugging crashes, breakpoints, etc.
|
|
119
|
+
|
|
120
|
+
Examples:
|
|
121
|
+
- Debug app: { deviceId: "00008030-00146...", bundleId: "com.myapp.ios" }
|
|
122
|
+
- Wait for debugger: { deviceId: "...", bundleId: "com.myapp.ios", waitForDebugger: true }
|
|
123
|
+
- With environment: { deviceId: "...", bundleId: "com.myapp.ios", environment: { "DEBUG": "1" } }`,
|
|
124
|
+
inputSchema: z.object({
|
|
125
|
+
deviceId: z.string().describe('Device UDID'),
|
|
126
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
127
|
+
waitForDebugger: z.boolean().optional().default(false).describe('Wait for debugger to attach before launching'),
|
|
128
|
+
environment: z.record(z.string()).optional().describe('Environment variables to set'),
|
|
129
|
+
arguments: z.array(z.string()).optional().describe('Command line arguments'),
|
|
130
|
+
}),
|
|
131
|
+
handler: async (options) => {
|
|
132
|
+
return xcodeTools.startDebugServer(options);
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
registerTool({
|
|
137
|
+
name: 'ios_attach_debugger',
|
|
138
|
+
description: `Attach debugger to a running process.
|
|
139
|
+
|
|
140
|
+
Attaches lldb to an already running app for debugging.
|
|
141
|
+
|
|
142
|
+
Examples:
|
|
143
|
+
- Attach by bundle ID: { deviceId: "...", bundleId: "com.myapp.ios" }
|
|
144
|
+
- Attach by PID: { deviceId: "...", bundleId: "com.myapp.ios", pid: 12345 }`,
|
|
145
|
+
inputSchema: z.object({
|
|
146
|
+
deviceId: z.string().describe('Device UDID'),
|
|
147
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
148
|
+
pid: z.number().optional().describe('Process ID (optional, uses bundle ID if omitted)'),
|
|
149
|
+
}),
|
|
150
|
+
handler: async (options) => {
|
|
151
|
+
return xcodeTools.attachToProcess(options);
|
|
152
|
+
},
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
// ============================================================================
|
|
156
|
+
// App Console (Filtered Logs)
|
|
157
|
+
// ============================================================================
|
|
158
|
+
|
|
159
|
+
registerTool({
|
|
160
|
+
name: 'ios_app_console',
|
|
161
|
+
description: `Stream console logs for a specific app.
|
|
162
|
+
|
|
163
|
+
Filters device logs to show only messages from the specified app. Useful for debugging app behavior.
|
|
164
|
+
|
|
165
|
+
Examples:
|
|
166
|
+
- Stream app logs for 30s: { deviceId: "...", bundleId: "com.myapp.ios" }
|
|
167
|
+
- Extended logging: { deviceId: "...", bundleId: "com.myapp.ios", timeoutSeconds: 60, maxLines: 2000 }`,
|
|
168
|
+
inputSchema: z.object({
|
|
169
|
+
deviceId: z.string().describe('Device UDID'),
|
|
170
|
+
bundleId: z.string().describe('App bundle identifier to filter logs'),
|
|
171
|
+
timeoutSeconds: z.number().min(5).max(300).default(30).describe('How long to collect logs'),
|
|
172
|
+
maxLines: z.number().min(10).max(5000).default(500).optional().describe('Maximum log lines'),
|
|
173
|
+
includeSystem: z.boolean().optional().default(false).describe('Include system logs (not just app)'),
|
|
174
|
+
}),
|
|
175
|
+
handler: async ({ deviceId, bundleId, timeoutSeconds, maxLines, includeSystem }) => {
|
|
176
|
+
const result = await xcodeTools.streamAppConsole({
|
|
177
|
+
deviceId,
|
|
178
|
+
bundleId,
|
|
179
|
+
timeoutMs: timeoutSeconds * 1000,
|
|
180
|
+
maxLines,
|
|
181
|
+
includeSystem,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
logCount: result.logs.length,
|
|
186
|
+
truncated: result.truncated,
|
|
187
|
+
logs: result.logs,
|
|
188
|
+
bundleId,
|
|
189
|
+
};
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
// ============================================================================
|
|
194
|
+
// Performance Profiling (Instruments)
|
|
195
|
+
// ============================================================================
|
|
196
|
+
|
|
197
|
+
registerTool({
|
|
198
|
+
name: 'ios_list_instruments_templates',
|
|
199
|
+
description: `List available Instruments templates for profiling.
|
|
200
|
+
|
|
201
|
+
Returns all available profiling templates like Time Profiler, Allocations, Leaks, etc.
|
|
202
|
+
|
|
203
|
+
Example:
|
|
204
|
+
- List templates: {}`,
|
|
205
|
+
inputSchema: z.object({}),
|
|
206
|
+
handler: async () => {
|
|
207
|
+
return xcodeTools.listInstrumentsTemplates();
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
registerTool({
|
|
212
|
+
name: 'ios_run_instruments',
|
|
213
|
+
description: `Run Instruments profiling on device.
|
|
214
|
+
|
|
215
|
+
Profiles app performance using the specified template. Results saved to trace file.
|
|
216
|
+
|
|
217
|
+
Examples:
|
|
218
|
+
- Time profile: { deviceId: "...", bundleId: "com.myapp.ios", template: "Time Profiler", outputPath: "/tmp/trace.trace" }
|
|
219
|
+
- Memory profile: { deviceId: "...", bundleId: "com.myapp.ios", template: "Allocations", outputPath: "/tmp/alloc.trace" }
|
|
220
|
+
- Leaks check: { deviceId: "...", bundleId: "com.myapp.ios", template: "Leaks", outputPath: "/tmp/leaks.trace" }`,
|
|
221
|
+
inputSchema: z.object({
|
|
222
|
+
deviceId: z.string().describe('Device UDID'),
|
|
223
|
+
template: z.string().describe('Instruments template name (e.g., "Time Profiler", "Allocations", "Leaks")'),
|
|
224
|
+
bundleId: z.string().optional().describe('App bundle identifier'),
|
|
225
|
+
appPath: z.string().optional().describe('Path to .app bundle'),
|
|
226
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
227
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
228
|
+
extraArgs: z.array(z.string()).optional().describe('Additional instruments arguments'),
|
|
229
|
+
}),
|
|
230
|
+
handler: async (options) => {
|
|
231
|
+
return xcodeTools.runInstruments({
|
|
232
|
+
deviceId: options.deviceId,
|
|
233
|
+
template: options.template,
|
|
234
|
+
bundleId: options.bundleId,
|
|
235
|
+
appPath: options.appPath,
|
|
236
|
+
outputPath: options.outputPath,
|
|
237
|
+
duration: options.duration,
|
|
238
|
+
extraArgs: options.extraArgs,
|
|
239
|
+
});
|
|
240
|
+
},
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
registerTool({
|
|
244
|
+
name: 'ios_profile_time',
|
|
245
|
+
description: `Run Time Profiler on app.
|
|
246
|
+
|
|
247
|
+
Profiles CPU usage to identify performance bottlenecks.
|
|
248
|
+
|
|
249
|
+
Examples:
|
|
250
|
+
- Profile for 60s: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/time-profile.trace" }`,
|
|
251
|
+
inputSchema: z.object({
|
|
252
|
+
deviceId: z.string().describe('Device UDID'),
|
|
253
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
254
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
255
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
256
|
+
}),
|
|
257
|
+
handler: async (options) => {
|
|
258
|
+
return xcodeTools.runTimeProfiler(options);
|
|
259
|
+
},
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
registerTool({
|
|
263
|
+
name: 'ios_profile_memory',
|
|
264
|
+
description: `Run Allocations profiler on app.
|
|
265
|
+
|
|
266
|
+
Tracks memory allocations to identify memory usage patterns.
|
|
267
|
+
|
|
268
|
+
Examples:
|
|
269
|
+
- Profile memory: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/allocations.trace" }`,
|
|
270
|
+
inputSchema: z.object({
|
|
271
|
+
deviceId: z.string().describe('Device UDID'),
|
|
272
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
273
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
274
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
275
|
+
}),
|
|
276
|
+
handler: async (options) => {
|
|
277
|
+
return xcodeTools.runAllocationsProfiler(options);
|
|
278
|
+
},
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
registerTool({
|
|
282
|
+
name: 'ios_profile_leaks',
|
|
283
|
+
description: `Run Leaks profiler on app.
|
|
284
|
+
|
|
285
|
+
Detects memory leaks in the application.
|
|
286
|
+
|
|
287
|
+
Examples:
|
|
288
|
+
- Check for leaks: { deviceId: "...", bundleId: "com.myapp.ios", outputPath: "/tmp/leaks.trace" }`,
|
|
289
|
+
inputSchema: z.object({
|
|
290
|
+
deviceId: z.string().describe('Device UDID'),
|
|
291
|
+
bundleId: z.string().describe('App bundle identifier'),
|
|
292
|
+
outputPath: z.string().describe('Path for output .trace file'),
|
|
293
|
+
duration: z.number().optional().default(60).describe('Profiling duration in seconds'),
|
|
294
|
+
}),
|
|
295
|
+
handler: async (options) => {
|
|
296
|
+
return xcodeTools.runLeaksProfiler(options);
|
|
297
|
+
},
|
|
298
|
+
});
|