pull_file
Transfer files from an Android device to your computer by specifying remote and local paths, enabling easy access to device content.
Instructions
Pull a file from the Android device to the local filesystem.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remote_path | Yes | Path on the device (e.g., /sdcard/somefile.txt) | |
| local_path | Yes | Local path to save the file to | |
| device_id | No | Device ID (optional if only one device) |
Implementation Reference
- src/adb.ts:409-416 (handler)The actual implementation of the pull_file functionality that executes the ADB command.
async pullFile(remotePath: string, localPath: string, deviceId?: string): Promise<string> { const dir = dirname(localPath); await mkdir(dir, { recursive: true }); const fullArgs = deviceId ? ["-s", deviceId, "pull", remotePath, localPath] : ["pull", remotePath, localPath]; const { stdout } = await execFileAsync(this.adbPath, fullArgs, { timeout: 30_000, - src/index.ts:573-585 (registration)The MCP tool registration and handler wrapper for pull_file.
server.tool( "pull_file", "Pull a file from the Android device to the local filesystem.", { remote_path: z.string().describe("Path on the device (e.g., /sdcard/somefile.txt)"), local_path: z.string().describe("Local path to save the file to"), device_id: z.string().optional().describe("Device ID (optional if only one device)"), }, async ({ remote_path, local_path, device_id }) => { const result = await adb.pullFile(remote_path, local_path, device_id); return { content: [{ type: "text", text: result.trim() || `Pulled ${remote_path} → ${local_path}` }] }; }, );