clear_app_data
Clear app data for a specific Android application on a connected device by providing its package name.
Instructions
Clear app data for a specific app on the connected Android device
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| package_name | Yes |
Implementation Reference
- src/espresso_mcp/server.py:167-175 (handler)The handler function for the 'clear_app_data' tool. It uses ADB to clear the app data for the specified package name. The @mcp.tool() decorator registers this function as an MCP tool.@mcp.tool() def clear_app_data(package_name: str) -> str: """Clear app data for a specific app on the connected Android device""" result = subprocess.run( ["adb", "shell", "pm", "clear", package_name], capture_output=True, text=True ) if result.returncode != 0: raise RuntimeError(f"Error clearing app data for '{package_name}': {result.stderr}") return f"App data for '{package_name}' has been cleared."
- src/espresso_mcp/server.py:167-167 (registration)The @mcp.tool() decorator registers the clear_app_data function as an MCP tool.@mcp.tool()