Skip to main content

Map · MapDiff

This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET

Map the actionable elements on the current screen and return them as refs (@e1, @e2, ...) with a label and role. These call app_map.

Map​

public IList<Element> Map()

The actionable elements on the current screen. Refs are valid only for this screen — call it again after anything that changes the screen, or just act, since actions re-resolve their target anyway.

MapDiff​

public IDictionary<string, object?> MapDiff()

Maps the current screen and says what changed since the last map of this device, which it then replaces: added is what appeared, removed what went away, and changed what changed its label, its checked state, a slider's value or its place, each as before, after and what — "label", "checked", "selected", "disabled", "value", "moved" or "resized". Taken right after an action, it is what that action just did, without the rest of the screen that stayed put. since is when the map compared with was taken. first is true when there was no earlier map to compare with, and then the whole screen is in added. Refs in added and in a change's after are the new map's; the earlier map's are gone.

Examples​

Map what can be acted on, with a ref for each​

foreach (var e in device.Map())
Console.WriteLine($"{e.Ref} {e.Role} {e.Label}");

The same call from the command line, mobium map, printed on an Android 15 emulator:

@e1 settings_homepage_container (list)
@e2 Profile picture, double tap to open Google Account (button)
@e3 Search settings (button)
@e4 main_content_scrollable_container (list)
@e5 Network & internet Mobile, Wi‑Fi, hotspot (button)
@e6 Connected devices Bluetooth, pairing (button)
@e7 Apps Assistant, recent apps, default apps (button)
@e8 Notifications Notification history, conversations (button)
@e9 Battery 100% (button)
@e10 Storage 51% used - 7.85 GB free (button)
@e11 Sound & vibration Volume, haptics, Do Not Disturb (button)

mobium map on an Android 15 emulator

mobium map on an Android 15 emulator

What the last action changed​

var diff = device.MapDiff();
Console.WriteLine(diff["added"]);
Console.WriteLine(diff["changed"]);