Skip to main content
Glama

android_list_emulators

List available Android emulators to manage virtual devices for development and testing.

Instructions

List available Android emulators

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'android_list_emulators' tool. It executes the 'emulator -list-avds' command, parses the output to list available AVDs, checks running status using the global runningEmulators map, and returns structured data with counts.
    handler: async () => { const result = await processExecutor.execute('emulator', ['-list-avds']); if (result.exitCode !== 0) { throw new Error(`Emulator listing failed: ${result.stderr}`); } const emulators = result.stdout .split('\n') .map(line => line.trim()) .filter(line => line.length > 0) .map(name => ({ name, isRunning: runningEmulators.has(name), pid: runningEmulators.get(name) || null, })); return { success: true, data: { emulators, totalCount: emulators.length, runningCount: emulators.filter(e => e.isRunning).length, }, }; }
  • Registration of the 'android_list_emulators' tool in the createAndroidTools function's tools Map. Includes name, description, empty input schema (no parameters required), and the handler function.
    tools.set('android_list_emulators', { name: 'android_list_emulators', description: 'List available Android emulators', inputSchema: { type: 'object', properties: {}, required: [] }, handler: async () => { const result = await processExecutor.execute('emulator', ['-list-avds']); if (result.exitCode !== 0) { throw new Error(`Emulator listing failed: ${result.stderr}`); } const emulators = result.stdout .split('\n') .map(line => line.trim()) .filter(line => line.length > 0) .map(name => ({ name, isRunning: runningEmulators.has(name), pid: runningEmulators.get(name) || null, })); return { success: true, data: { emulators, totalCount: emulators.length, runningCount: emulators.filter(e => e.isRunning).length, }, }; } });
  • Input schema for the tool, which is an empty object since the tool requires no input parameters.
    inputSchema: { type: 'object', properties: {}, required: []
  • Initialization of the runningEmulators map from the globalProcessMap parameter, used by the handler to check emulator running status.
    runningEmulators = globalProcessMap;

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