Skip to main content
Glama

native_run_install_app

Install Android APK or iOS app files directly to mobile devices using native-run for development testing and deployment.

Instructions

Install app on device using native-run (works for Android APK & iOS app)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformNoandroid
appPathYes
deviceIdNo

Implementation Reference

  • The handler function that implements the core logic for the native_run_install_app tool: parses input arguments, checks if native-run is available, constructs the native-run command with appropriate flags, executes the process, handles errors, and returns a structured success response.
    handler: async (args: any) => {
      const parsed = NativeRunInstallAppSchema.parse(args);
      
      if (!(await isNativeRunAvailable())) {
        throw new Error('native-run is not installed. Install with: npm install -g native-run');
      }
    
      const runArgs = [
        parsed.platform,
        '--app', parsed.appPath,
        '--device'
      ];
    
      if (parsed.deviceId) {
        runArgs.push('--target', parsed.deviceId);
      }
    
      const result = await processExecutor.execute('native-run', runArgs);
    
      if (result.exitCode !== 0) {
        throw new Error(`Failed to install app on ${parsed.platform}: ${result.stderr}`);
      }
    
      return {
        success: true,
        data: {
          message: `App installed successfully on ${parsed.platform}`,
          platform: parsed.platform,
          appPath: parsed.appPath,
          deviceId: parsed.deviceId,
          tool: 'native-run'
        },
      };
    }
  • Zod validation schema defining the input parameters for the native_run_install_app tool: platform (android/ios), appPath (required), and optional deviceId.
    const NativeRunInstallAppSchema = z.object({
      platform: z.enum(['android', 'ios']).default('android'),
      appPath: z.string().min(1),
      deviceId: z.string().optional(),
    });
  • Registers the native_run_install_app tool in the createNativeRunTools() function's Map, including name, description, inputSchema (JSON Schema equivalent), and reference to the handler function.
    tools.set('native_run_install_app', {
      name: 'native_run_install_app',
      description: 'Install app on device using native-run (works for Android APK & iOS app)',
      inputSchema: {
        type: 'object',
        properties: {
          platform: {
            type: 'string',
            enum: ['android', 'ios'],
            default: 'android'
          },
          appPath: {
            type: 'string',
            minLength: 1
          },
          deviceId: {
            type: 'string'
          }
        },
        required: ['appPath']
      },
      handler: async (args: any) => {
        const parsed = NativeRunInstallAppSchema.parse(args);
        
        if (!(await isNativeRunAvailable())) {
          throw new Error('native-run is not installed. Install with: npm install -g native-run');
        }
    
        const runArgs = [
          parsed.platform,
          '--app', parsed.appPath,
          '--device'
        ];
    
        if (parsed.deviceId) {
          runArgs.push('--target', parsed.deviceId);
        }
    
        const result = await processExecutor.execute('native-run', runArgs);
    
        if (result.exitCode !== 0) {
          throw new Error(`Failed to install app on ${parsed.platform}: ${result.stderr}`);
        }
    
        return {
          success: true,
          data: {
            message: `App installed successfully on ${parsed.platform}`,
            platform: parsed.platform,
            appPath: parsed.appPath,
            deviceId: parsed.deviceId,
            tool: 'native-run'
          },
        };
      }
    });
  • Helper function used by the handler to check if the native-run CLI tool is installed and available in the system PATH.
    async function isNativeRunAvailable(): Promise<boolean> {
      try {
        await processExecutor.execute('native-run', ['--version']);
        return true;
      } catch {
        return false;
      }
    }
  • Metadata entry in the global TOOL_REGISTRY categorizing the native_run_install_app tool with its requirements, performance expectations, and safety flags.
    'native_run_install_app': {
      name: 'native_run_install_app',
      category: ToolCategory.ESSENTIAL,
      platform: 'cross-platform',
      requiredTools: [RequiredTool.NATIVE_RUN],
      description: 'Install app using native-run (APK/iOS)',
      safeForTesting: false,
      performance: { expectedDuration: 20000, timeout: 120000 }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden but only states the basic function. It doesn't disclose behavioral traits such as required permissions, whether installation is destructive, error handling, or output format. This leaves significant gaps for a tool that performs device-level operations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with no wasted words. It front-loads the core purpose ('Install app on device') and adds necessary technical context ('using native-run') and scope ('works for Android APK & iOS app').

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 3 parameters, 0% schema coverage, no annotations, and no output schema, the description is inadequate. It lacks details on parameter usage, behavioral expectations, error cases, and output, making it incomplete for safe and effective agent invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds minimal semantics beyond the schema: it implies 'appPath' is for Android APK or iOS app files, and 'platform' selects between them. However, with 0% schema description coverage, it doesn't fully compensate for undocumented parameters like 'deviceId' or provide format details for 'appPath'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Install app') and target ('on device'), specifying it uses 'native-run' and works for both Android APK and iOS app. It distinguishes from siblings like 'android_install_apk' by mentioning cross-platform capability, though it doesn't explicitly contrast with them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives like 'android_install_apk' or 'ios_boot_simulator'. The description mentions it works for both platforms, but doesn't specify scenarios, prerequisites, or exclusions for its use.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/cristianoaredes/mcp-mobile-server'

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