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 List<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.
@return the elements, each with a ref
mapDiff
public Map<String, Object> mapDiff()
Maps the screen and says how it differs from the last map of this device: what appeared, what went away, and what changed its label, its checked state or its place. Called after an action, it is what that action just did.
added and removed are lists of elements;
changed holds before, after and what,
which names each of "label", "checked" and
"moved" that differs. since is when the earlier map 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 each
after are the new map's, so they can be acted on at once; those
in removed and before belong to a screen that is gone.
@return the diff, with added, removed and changed,
and first or since
Examples
Map what can be acted on, with a ref for each
for (Element e : device.map()) {
System.out.println(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
What the last action changed
Map<String, Object> diff = device.mapDiff();
System.out.println(diff.get("added"));
System.out.println(diff.get("changed"));