Skip to main content

mobium press

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

Press a hardware button

On Android, back is primary navigation — an app that opened a detail screen expects it, and no amount of tapping substitutes for it.

iOS has no back button by design: navigation back is a per-app affordance there, and press back is refused rather than sent as a swipe. --gesture asks for the swipe by name, on either platform: in from the left edge, in the navigation bar on iOS. On Android it is refused where the device navigates with buttons, since an edge swipe is not back there.

Back says what it did: whether it left the app, what is in front now, and on iOS what the navigation bar says.

The D-pad and select are how a TV is driven: a D-pad press says where focus went, or that it did not move, and select activates what has focus. The media keys go to whichever app holds the media session, and are reported as sent. iOS has none of them.

Any press can move the screen, so refs from the last map are discarded.

Usage​

mobium press <back | home | recents | volume-up | volume-down | dpad-up | dpad-down | dpad-left | dpad-right | select | play-pause | stop | next | previous | rewind | fast-forward> [flags]

Flags​

FlagTypeDefaultWhat it does
--gestureboolback as a swipe in from the left edge, not the key

And the global flags.

Examples​

Press Back​

mobium press back

Printed on an Android 15 emulator:

pressed back
BeforeAfter
Before: mobium press back on an Android 15 emulatorAfter: mobium press back on an Android 15 emulator

mobium press back on an Android 15 emulator

Go to the home screen​

mobium press home

Printed on an Android 15 emulator:

pressed home — com.google.android.apps.nexuslauncher is in the foreground

mobium press home on an Android 15 emulator

mobium press home on an Android 15 emulator

Move focus with a TV remote's D-pad​

mobium press dpad-down

Printed on an Android 15 emulator:

pressed dpad-down — focus moved to homepage_container

Go back with a swipe in from the edge​

mobium press back --gesture

Printed on an Android 15 emulator:

swiped back from the left edge, halfway down — com.android.settings is still in the foreground; app_map shows which screen

More, from mobium press --help​

mobium press back
mobium press back --gesture
mobium press home
mobium press recents
mobium press dpad-down
mobium press select

The tool​

press calls app_press; its arguments and what every client calls it are there.