adb_push_file
Transfer files from your computer to an Android device using the Android Debug Bridge (ADB). Specify local and remote file paths to move data to the device.
Instructions
Push a file from local system to device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| localPath | Yes | Local file path | |
| remotePath | Yes | Remote file path on device | |
| deviceId | No | Device ID (optional) |
Implementation Reference
- src/tools/file.ts:7-45 (handler)The main handler function for adb_push_file tool. Executes adb push command using AdbClient after checking device connection.async pushFile(localPath: string, remotePath: string, deviceId?: string) { try { const connected = await this.adbClient.isDeviceConnected(deviceId); if (!connected) { return { success: false, error: 'Device not connected', message: 'Cannot push file - device is not connected' }; } const command = `push "${localPath}" "${remotePath}"`; const result = await this.adbClient.executeCommand(command, deviceId); if (!result.success) { return { success: false, error: result.error, message: 'Failed to push file' }; } return { success: true, data: { localPath, remotePath, deviceId: deviceId || this.adbClient.getDefaultDevice() }, message: `File pushed from ${localPath} to ${remotePath}` }; } catch (error: any) { return { success: false, error: error.message, message: 'Failed to push file' }; } }
- src/index.ts:292-313 (schema)Tool schema definition including input schema for parameters: localPath (required), remotePath (required), deviceId (optional). Part of tool registration list.{ name: 'adb_push_file', description: 'Push a file from local system to device', inputSchema: { type: 'object', properties: { localPath: { type: 'string', description: 'Local file path', }, remotePath: { type: 'string', description: 'Remote file path on device', }, deviceId: { type: 'string', description: 'Device ID (optional)', }, }, required: ['localPath', 'remotePath'], }, },
- src/index.ts:465-466 (registration)Registration in the tool dispatch switch statement, calling the FileTools.pushFile handler.case 'adb_push_file': return await this.handleToolCall(this.fileTools.pushFile(args?.localPath as string, args?.remotePath as string, args?.deviceId as string));