pull_file
Download files from Android devices to your local machine by specifying remote and local paths. This tool transfers data from connected Android devices for backup, analysis, or processing.
Instructions
Download a file from the Android device to the local machine.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remote_path | Yes | Absolute path on the Android device | |
| local_path | Yes | Local filesystem path to save the file to | |
| device_id | No | Device serial number |
Implementation Reference
- src/adb/file-manager.ts:65-78 (handler)Actual implementation of the pull_file tool logic, executing ADB pull.
export async function pullFile( remotePath: string, localPath: string, deviceId?: string ): Promise<string> { const resolved = await deviceManager.resolveDeviceId(deviceId); const validRemote = validateDevicePath(remotePath); validateLocalPath(localPath); const result = await adbExec(['pull', validRemote, localPath], resolved, 60000); log.info('File pulled', { remotePath: validRemote, localPath, deviceId: resolved }); return `${result.stdout}\n${result.stderr}`.trim(); } - src/controllers/file-tools.ts:30-51 (registration)MCP registration and handler wrapper for the 'pull_file' tool.
server.registerTool( 'pull_file', { description: 'Download a file from the Android device to the local machine.', inputSchema: { remote_path: z.string().describe('Absolute path on the Android device'), local_path: z.string().describe('Local filesystem path to save the file to'), device_id: z.string().optional().describe('Device serial number'), }, }, async ({ remote_path, local_path, device_id }) => { return await metrics.measure('pull_file', device_id || 'default', async () => { const result = await pullFile(remote_path, local_path, device_id); return { content: [{ type: 'text' as const, text: JSON.stringify({ success: true, message: result }, null, 2), }], }; }); } );