get_flutter_logs
Retrieve Flutter-specific logs from Android devices to debug Flutter applications during development and testing workflows.
Instructions
Get Flutter-specific logs
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | ||
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:724-735 (handler)The main handler function for the 'get_flutter_logs' tool. It retrieves recent logcat logs and filters them for Flutter/Dart related entries using specified keywords. Registered via @mcp.tool() decorator.@mcp.tool() def get_flutter_logs(lines: int = 100, device_serial: str | None = None) -> str: """Get Flutter-specific logs""" output = run_adb(["shell", "logcat", "-d", "-t", str(lines)], device_serial) # Filter for Flutter-related logs flutter_keywords = ['flutter', 'dart', 'FlutterEngine', 'FlutterActivity'] log_lines = output.split('\n') flutter_lines = [l for l in log_lines if any(kw.lower() in l.lower() for kw in flutter_keywords)] return '\n'.join(flutter_lines) if flutter_lines else "No Flutter logs found"