Read the foreground Android app
mobile_app_foregroundIdentify the app in the foreground on an Android display by returning its focused package and activity. Use for device inspection when you need to know which app is active.
Instructions
Return the focused package and activity for one logical display. Window focus is preferred; activity tops are the fallback.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | Yes | Exact ADB serial from mobile_devices_list; never inferred when multiple devices exist | |
| displayId | No | Android framework logical display ID, not a SurfaceFlinger physical ID |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| serial | Yes | ||
| source | Yes | ||
| taskId | No | ||
| activity | No | ||
| displayId | Yes | ||
| packageName | No | ||
| focusedWindow | No |