Skip to main content
Glama

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
NameRequiredDescriptionDefault
local_pathYesLocal filesystem path of the file to upload
remote_pathYesAbsolute path on the Android device to save to
device_idNoDevice serial number

Implementation Reference

  • 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();
    }
  • 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),
            }],
          };
        });
      }
    );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/divineDev-dotcom/android_mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server