clear_logs
Clear the Android device logcat buffer to obtain clean logs for debugging. Use before reproducing bugs to isolate relevant log entries.
Instructions
Clear the logcat buffer. Call this before reproducing a bug to get clean logs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device_id | No | Device ID (optional if only one device) |
Implementation Reference
- src/adb.ts:405-407 (handler)The implementation of the clear_logs logic via adb command.
async clearLogcat(deviceId?: string): Promise<void> { await this.exec(["logcat", "-c"], deviceId); } - src/index.ts:542-550 (registration)The MCP tool registration and handler for clear_logs.
server.tool( "clear_logs", "Clear the logcat buffer. Call this before reproducing a bug to get clean logs.", { device_id: z.string().optional().describe("Device ID (optional if only one device)") }, async ({ device_id }) => { await adb.clearLogcat(device_id); return { content: [{ type: "text", text: "Logcat buffer cleared" }] }; }, );