toggle_airplane_mode
Enable or disable airplane mode on Android devices to manage network connectivity during development, testing, and debugging workflows.
Instructions
Enable or disable airplane mode
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| enable | Yes | ||
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:844-852 (handler)The handler function for toggle_airplane_mode tool, decorated with @mcp.tool() for automatic registration in MCP. Executes ADB commands to set airplane_mode_on global setting and broadcasts the AIRPLANE_MODE intent.@mcp.tool() def toggle_airplane_mode(enable: bool, device_serial: str | None = None) -> str: """Enable or disable airplane mode""" value = "1" if enable else "0" run_adb(["shell", "settings", "put", "global", "airplane_mode_on", value], device_serial) # Broadcast the change intent = "android.intent.action.AIRPLANE_MODE" run_adb(["shell", "am", "broadcast", "-a", intent], device_serial) return f"Airplane mode {'enabled' if enable else 'disabled'}"