clear_app_data
Remove app data for a specified Android app on the connected device by providing the package name, ensuring a clean state for testing or troubleshooting.
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' MCP tool, decorated with @mcp.tool() which also serves as its registration. It uses adb to clear the data of the specified Android app package.@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."