MCPcopy
hub / github.com/mobile-next/mobile-mcp / getDevices

Method getDevices

src/mobilecli.ts:171–198  ·  view source on GitHub ↗
(options?: MobilecliDevicesOptions)

Source from the content-addressed store, hash-verified

169 }
170
171 getDevices(options?: MobilecliDevicesOptions): MobilecliDevicesResponse {
172 const args = ["devices"];
173
174 if (options) {
175 if (options.includeOffline) {
176 args.push("--include-offline");
177 }
178
179 if (options.platform) {
180 if (options.platform !== "ios" && options.platform !== "android") {
181 throw new Error(`Invalid platform: ${options.platform}. Must be "ios" or "android"`);
182 }
183
184 args.push("--platform", options.platform);
185 }
186
187 if (options.type) {
188 if (options.type !== "real" && options.type !== "emulator" && options.type !== "simulator") {
189 throw new Error(`Invalid type: ${options.type}. Must be "real", "emulator", or "simulator"`);
190 }
191
192 args.push("--type", options.type);
193 }
194 }
195
196 const mobilecliOutput = this.executeCommand(args);
197 return JSON.parse(mobilecliOutput) as MobilecliDevicesResponse;
198 }
199}

Callers 4

createMcpServerFunction · 0.95
mobilecli.test.tsFile · 0.80
getRobotFromDeviceFunction · 0.80

Calls 1

executeCommandMethod · 0.95

Tested by

no test coverage detected