Skip to main content
Glama

installPlatformDependencies

Install required dependencies and tools for Android or iOS platforms in the AutoMobile MCP server to enable mobile automation testing.

Instructions

Install required dependencies and tools for the specified platform

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesTarget platform to install dependencies for
updateNoUpdate behavior: force=always update, ifAvailable=update if detected but don't fail, never=don't updateifAvailable

Implementation Reference

  • Main handler function for the 'installPlatformDependencies' tool. Dispatches to platform-specific installation functions based on the platform argument.
    const installPlatformDependenciesHandler = async ( args: InstallPlatformDependenciesArgs, progress?: ProgressCallback ) => { try { if (args.platform === "android") { return await installAndroidDependencies(args, progress); } else if (args.platform === "ios") { return await installIOSDependencies(args, progress); } else { throw new ActionableError(`Unsupported platform: ${args.platform}`); } } catch (error) { throw new ActionableError(`Failed to install ${args.platform} dependencies: ${error}`); } };
  • Zod schema defining the input parameters for the tool: platform (android/ios) and optional update strategy.
    export const installPlatformDependenciesSchema = z.object({ platform: z.enum(["android", "ios"]).describe("Target platform to install dependencies for"), update: z.enum(["force", "ifAvailable", "never"]).optional().default("ifAvailable").describe("Update behavior: force=always update, ifAvailable=update if detected but don't fail, never=don't update") });
  • Registration of the tool with ToolRegistry, including name, description, schema, handler, and progress support flag.
    ToolRegistry.register( "installPlatformDependencies", "Install required dependencies and tools for the specified platform", installPlatformDependenciesSchema, installPlatformDependenciesHandler, true // Supports progress notifications );
  • Core helper function implementing Android platform dependency installation, including setup, optional updates, progress reporting, and result formatting.
    async function installAndroidDependencies( args: InstallPlatformDependenciesArgs, progress?: ProgressCallback ): Promise<any> { logger.info(`Installing Android dependencies with update: ${args.update}`); if (progress) { await progress(10, 100, "Starting Android dependency installation..."); } // Determine if we should force installation based on update parameter let shouldForce = false; if (args.update === "force") { shouldForce = true; } else if (args.update === "never") { shouldForce = false; } // For "ifAvailable", we'll handle updates separately // Always use comprehensive setup - AutoMobile is opinionated about providing complete environment const setupParams: CompleteSetupParams = { installJava: true, installXcodeTools: true, force: shouldForce }; if (progress) { await progress(30, 100, "Setting up complete Android development environment..."); } const result = await setupCompleteAndroidEnvironment(setupParams); // Handle updates if requested and installation was successful but not forced let updateResult = null; if (args.update === "ifAvailable" && result.success && !shouldForce) { if (progress) { await progress(60, 100, "Checking for available updates..."); } try { // Attempt to update by forcing a reinstall const updateParams: CompleteSetupParams = { installJava: true, installXcodeTools: true, force: true }; updateResult = await setupCompleteAndroidEnvironment(updateParams); logger.info(`Update attempt completed: ${updateResult.success ? "successful" : "failed"}`); } catch (error) { logger.warn(`Update attempt failed but continuing: ${error}`); // Don't fail the overall operation for update failures when using "ifAvailable" } } if (progress) { await progress(100, 100, "Complete Android environment setup finished"); } return createJSONToolResponse({ success: result.success, message: result.success ? "Complete Android development environment installed" : "Some components failed to install", platform: "android", updateMode: args.update, steps: result.steps, environmentVariables: result.environmentVariables, recommendations: result.recommendations, updateAttempted: args.update === "ifAvailable" && updateResult !== null, updateSuccessful: updateResult?.success || false }); }
  • TypeScript interface defining the argument shape for type safety, matching the schema.
    export interface InstallPlatformDependenciesArgs { platform: SomePlatform; update?: "force" | "ifAvailable" | "never"; }

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/zillow/auto-mobile'

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