push_file
Upload files from your computer to an Android device using ADB commands. Specify local file path, destination on device, and device ID to transfer data.
Instructions
Upload a file from the local machine to the Android device.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| local_path | Yes | Local filesystem path of the file to upload | |
| remote_path | Yes | Absolute path on the Android device to save to | |
| device_id | No | Device serial number |
Implementation Reference
- src/adb/file-manager.ts:83-96 (handler)The core logic implementation for pushing a file to a device.
export async function pushFile( localPath: string, remotePath: string, deviceId?: string ): Promise<string> { const resolved = await deviceManager.resolveDeviceId(deviceId); validateLocalPath(localPath); const validRemote = validateDevicePath(remotePath); const result = await adbExec(['push', localPath, validRemote], resolved, 60000); log.info('File pushed', { localPath, remotePath: validRemote, deviceId: resolved }); return `${result.stdout}\n${result.stderr}`.trim(); } - src/controllers/file-tools.ts:53-74 (registration)MCP tool registration and handler wrapper for 'push_file'.
server.registerTool( 'push_file', { description: 'Upload a file from the local machine to the Android device.', inputSchema: { local_path: z.string().describe('Local filesystem path of the file to upload'), remote_path: z.string().describe('Absolute path on the Android device to save to'), device_id: z.string().optional().describe('Device serial number'), }, }, async ({ local_path, remote_path, device_id }) => { return await metrics.measure('push_file', device_id || 'default', async () => { const result = await pushFile(local_path, remote_path, device_id); return { content: [{ type: 'text' as const, text: JSON.stringify({ success: true, message: result }, null, 2), }], }; }); } );