android-log
Retrieve specific logs from an Android device using the MCP server, including logcat, app, ANR, crash logs, and battery stats, with customizable parameters for precise data extraction.
Instructions
Perform various log retrieval operations on an Android device.
This single tool consolidates various log-related actions. The 'action' parameter determines the operation.
Args:
serial: Device serial number.
action: The specific log operation to perform.
ctx: MCP Context for logging and interaction.
package (Optional[str]): Package name for get_app_logs
action.
lines (int): Number of lines to fetch for logcat actions (default: 1000).
filter_expr (Optional[str]): Logcat filter expression for get_device_logcat
.
buffer (Optional[str]): Logcat buffer for get_device_logcat
(default: "main").
format_type (Optional[str]): Logcat output format for get_device_logcat
(default: "threadtime").
max_size (Optional[int]): Max output size for get_device_logcat
(default: 100KB).
Returns: A string message containing the requested logs or status.
Available Actions and their specific argument usage:
action="get_device_logcat"
- Optional:
lines
,filter_expr
,buffer
,format_type
,max_size
.
- Optional:
action="get_app_logs"
- Requires:
package
. - Optional:
lines
.
- Requires:
action="get_anr_logs"
- No specific arguments beyond
serial
andctx
.
- No specific arguments beyond
action="get_crash_logs"
- No specific arguments beyond
serial
andctx
.
- No specific arguments beyond
action="get_battery_stats"
- No specific arguments beyond
serial
andctx
.
- No specific arguments beyond
Input Schema
Name | Required | Description | Default |
---|---|---|---|
action | Yes | ||
buffer | No | main | |
filter_expr | No | ||
format_type | No | threadtime | |
lines | No | ||
max_size | No | ||
package | No | ||
serial | Yes |