Skip to main content
Glama

disableDemoMode

Restore standard status bar functionality by disabling demo mode on Android or iOS devices. Supports platform-specific automation for streamlined mobile testing workflows.

Instructions

Disable demo mode and return to normal status bar behavior

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
platformYesTarget platform

Implementation Reference

  • Handler function for the disableDemoMode tool, which creates a DemoMode instance and calls exitDemoMode on the device.
    const disableDemoModeHandler = async (device: BootedDevice) => { try { const demoMode = new DemoMode(device); const result = await demoMode.exitDemoMode(); return createJSONToolResponse({ message: "Demo mode disabled", observation: result.observation, ...result, demoModeEnabled: false }); } catch (error) { logger.error("Failed to disable demo mode:", error); throw new ActionableError(`Failed to disable demo mode: ${error}`); } };
  • Zod schema defining the input parameters for the disableDemoMode tool, requiring the target platform.
    export const disableDemoModeSchema = z.object({ platform: z.enum(["android", "ios"]).describe("Target platform") });
  • Registration of the disableDemoMode tool with the ToolRegistry, including name, description, schema, and handler.
    ToolRegistry.registerDeviceAware( "disableDemoMode", "Disable demo mode and return to normal status bar behavior", disableDemoModeSchema, disableDemoModeHandler );
  • Supporting method in DemoMode class that executes the ADB command to exit demo mode on Android devices.
    async exitDemoMode(): Promise<DemoModeResult> { try { // Get current package name from active window const activeWindow = await this.window.getActive(true); logger.info("Exiting Android demo mode for current app:", activeWindow.appId); await this.adb.executeCommand("shell am broadcast -a com.android.systemui.demo -e command exit"); logger.info("Successfully exited demo mode"); return { success: true, message: "Demo mode disabled successfully", demoModeEnabled: false, packageName: activeWindow.appId, activityName: activeWindow.activityName }; } catch (err) { const errorMessage = err instanceof Error ? err.message : String(err); logger.error("Failed to exit demo mode:", err); return { success: false, error: `Failed to exit demo mode: ${errorMessage}`, demoModeEnabled: true }; } }

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