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.
TypeScript agentandroidandroid-automationappium-alternativeclaude-codecodexcursoremulatoriosios-automationmcpmcp-servermobilemobile-automationmobile-testingreal-devicesimulatorskills
fix: screenshot beyond 200K works without errors
gmegidish4a920efdf842
diff --git a/src/android.ts b/src/android.tsindex d6d8fc2..60d5adc 100644--- a/src/android.ts+++ b/src/android.ts@@ -1,5 +1,6 @@import { exec, execSync } from "child_process";import * as xml from "fast-xml-parser";+import { readFileSync, unlinkSync } from "fs";interface Bounds {left: number;@@ -134,6 +135,18 @@ export const swipe = (direction: "up" | "down" | "left" | "right") => {}export const takeScreenshot = async (): Promise<Buffer> => {- const screenshot = execSync(`adb exec-out screencap -p`);+ const randomFilename = `screenshot-${Date.now()}.png`;++ // take screenshot and save on device+ const remoteFilename = `/sdcard/Download/${randomFilename}`;+ execSync(`adb shell screencap -p ${remoteFilename}`);++ // pull the file locally+ const localFilename = `/tmp/${randomFilename}`;+ execSync(`adb pull ${remoteFilename} ${localFilename}`);+ execSync(`adb shell rm ${remoteFilename}`);++ const screenshot = readFileSync(localFilename);+ unlinkSync(localFilename);return screenshot;}