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: always use .exe extension when finding adb path on windows

Matthew Wartman178b2fbdd464
diff --git a/src/android.ts b/src/android.ts
index cfdcc79..94ba18b 100644
--- a/src/android.ts
+++ b/src/android.ts
@@ -29,8 +29,9 @@ interface UiAutomatorXml {
}
const getAdbPath = (): string => {
+ const exeName = process.env.platform === "win32" ? "adb.exe" : "adb";
if (process.env.ANDROID_HOME) {
- return path.join(process.env.ANDROID_HOME, "platform-tools", "adb");
+ return path.join(process.env.ANDROID_HOME, "platform-tools", exeName);
}
if (process.platform === "win32" && process.env.LOCALAPPDATA) {
@@ -40,7 +41,7 @@ const getAdbPath = (): string => {
}
}
- if (process.env.HOME) {
+ if (process.platform === "darwin" && process.env.HOME) {
const defaultAndroidSdk = path.join(process.env.HOME, "Library", "Android", "sdk", "platform-tools", "adb");
if (existsSync(defaultAndroidSdk)) {
return defaultAndroidSdk;
@@ -48,7 +49,7 @@ const getAdbPath = (): string => {
}
// fallthrough, hope for the best
- return "adb";
+ return exeName;
};
const BUTTON_MAP: Record<Button, string> = {