Navigation & Device

Steps for pressing buttons, navigating back/home, opening deep links, setting GPS location, and clearing app state.

pressButton

Press a hardware or software button.

Parameters

FieldTypeRequiredDescription
buttonstringYesButton id (e.g. home, back)

Example

- pressButton:
    button: back

back

Press the back button. Shorthand for pressButton: { button: BACK }.

No parameters.

Example

- back:

home

Press the home button. Shorthand for pressButton: { button: HOME }.

No parameters.

Example

- home:

hideKeyboard

Dismiss the keyboard. Sends Escape key (HID 41) on iOS and BACK on Android.

No parameters.

Example

- hideKeyboard:

Open a deep link.

Parameters

FieldTypeRequiredDescription
urlstringYesDeep link URL

Example

- openDeepLink:
    url: myapp://screen/settings

setLocation

Set GPS location on the simulator (iOS) or emulator (Android).

Parameters

FieldTypeRequiredDescription
latitudenumberYesLatitude (-90–90)
longitudenumberYesLongitude (-180–180)

Example

- setLocation:
    latitude: 37.5665
    longitude: 126.978

Tips

  • iOS: All simulators supported (idb set-location).
  • Android: Emulator only. adb emu geo fix does not work on physical devices.

clearState

Clear app data or reset permissions.

Parameters

FieldTypeRequiredDescription
(value)stringYesiOS: bundle ID. Android: package.

Example

- clearState: org.reactnativemcp.demo

Tips

PlatformBehavior
iOSsimctl privacy reset all — resets permissions only. App sandbox (documents, caches) is not cleared. Full reset requires uninstall + reinstall.
Androidpm clear — clears all app data (AsyncStorage, SharedPreferences, etc.).