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.

test: don't run android tests unless exactly one device found

gmegidishd0412f21f5dd
diff --git a/test/android.ts b/test/android.ts
index 192ed43..a94f54b 100644
--- a/test/android.ts
+++ b/test/android.ts
@@ -4,12 +4,14 @@ import sharp from "sharp";
import { AndroidRobot, getConnectedDevices } from "../src/android";
-describe("android", () => {
+const devices = getConnectedDevices();
+const hasOneAndroidDevice = devices.length === 1;
- const devices = getConnectedDevices();
- if (devices.length === 0) {
- throw new Error("No Android devices found");
- }
+if (!hasOneAndroidDevice) {
+ console.error("No Android devices found");
+}
+
+hasOneAndroidDevice && describe("android", () => {
const android = new AndroidRobot(devices[0]);