device_focus_events
Read recent Android focus-change events from logcat. Useful AFTER a tap on an input field and BEFORE device_type to verify focus actually landed on the expected element — diagnoses the "type went into the wrong field" race that bites parallel tap+type sequences. Filters to ViewRootImpl (window focus), WindowManager (focus transitions), and InputMethodManager (IME show/hide) events. Returns a short summary line followed by the matching logcat lines (newest last). Empty result = no focus events in the recent window, which usually means the tap did NOT change focus (tap missed, or you tapped a non-focusable element).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| max | No | Max focus events to return (default: 30, capped at 500). Newest last. | |
| udid | Yes | Device serial number (UDID) |