check_flutter_app_running
Check if a Flutter app is currently running in the foreground on an Android device. Use this tool to verify app state during development, testing, or debugging workflows.
Instructions
Check if a Flutter app is currently in foreground
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_serial | No |
Implementation Reference
- src/adb_mcp_server/server.py:1025-1043 (handler)The handler function implementing the 'check_flutter_app_running' tool. It checks the current foreground activity for Flutter indicators and scans recent logcat output for Flutter logs. The @mcp.tool() decorator registers it as an MCP tool.@mcp.tool() def check_flutter_app_running(device_serial: str | None = None) -> dict: """Check if a Flutter app is currently in foreground""" activity = get_current_activity(device_serial) # Check if it's a Flutter activity is_flutter = False if activity.get('activity'): is_flutter = 'flutter' in activity['activity'].lower() # Also check for Flutter in logcat logs = run_adb(["shell", "logcat", "-d", "-t", "20", "-s", "flutter"], device_serial) has_recent_flutter_logs = len(logs.strip()) > 0 return { "current_activity": activity, "likely_flutter_app": is_flutter or has_recent_flutter_logs, "recent_flutter_logs": has_recent_flutter_logs }