Skip to content

Mobile MCP: let AI agents drive your iOS and Android apps. MCP server for simulators, emulators and real devices. Works with Claude Code, Codex, Cursor and any MCP client.

fix: support for platforms that don't have xcrun (linux and windows)

gmegidish7fddba71af51
diff --git a/src/iphone-simulator.ts b/src/iphone-simulator.ts
index 55bbdeb..b375a6d 100644
--- a/src/iphone-simulator.ts
+++ b/src/iphone-simulator.ts
@@ -173,17 +173,28 @@ export class Simctl implements Robot {
export class SimctlManager {
public listSimulators(): Simulator[] {
- const text = execFileSync("xcrun", ["simctl", "list", "devices", "-j"]).toString();
- const json: ListDevicesResponse = JSON.parse(text);
- return Object.values(json.devices).flatMap(device => {
- return device.map(d => {
- return {
- name: d.name,
- uuid: d.udid,
- state: d.state,
- };
+ // detect if this is a mac
+ if (process.platform !== "darwin") {
+ // don't even try to run xcrun
+ return [];
+ }
+
+ try {
+ const text = execFileSync("xcrun", ["simctl", "list", "devices", "-j"]).toString();
+ const json: ListDevicesResponse = JSON.parse(text);
+ return Object.values(json.devices).flatMap(device => {
+ return device.map(d => {
+ return {
+ name: d.name,
+ uuid: d.udid,
+ state: d.state,
+ };
+ });
});
- });
+ } catch (error) {
+ console.error("Error listing simulators", error);
+ return [];
+ }
}
public listBootedSimulators(): Simulator[] {