Skip to main content

app_location

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

Read where the device believes it is, or place it somewhere. Takes latitude and longitude, or clear to stop pretending. The two platforms answer different numbers of questions and this says which. Android sets through a test provider and reads the position back tagged as injected, so a set can be confirmed — and it works on real hardware, which adb emu geo fix does not. iOS sets through simctl and cannot be read at all: simctl location has set, clear, run and start and no get, so there the answer confirms the request was accepted and nothing more. Reading a position back is only evidence a set took because the reply also says the fix was injected: a device holds its last position across boots, so asking for a place it already was would otherwise look identical to success. Pass waypoints or gpx to move along a route instead: the simulator interpolates one itself, while on Android the daemon steps a test provider once a second because the platform has no route command.

Changes the device, the app or the session: readOnlyHint is false.

Arguments​

NameTypeRequiredWhat it is
clearbooleanRemove the injected position so the device reports its own again. Also stops a running route.
devicestringDevice serial to target, e.g. "emulator-5554". Omit when only one device is running.
driverstring: uiautomator2, uiautomator, wdaDriver to use: "uiautomator2" (default for Android; fast, installs a server APK on first use), "uiautomator" (Android, installs nothing, slower, cannot type), or "wda" (WebDriverAgent: iOS simulators and iPhones).
gpxstringPath to a GPX file to follow instead of waypoints. Track points are used first, then route points, then loose waypoints.
gpx_datastringA GPX document's content, instead of gpx's path — for a daemon on another machine; the CLI and pipe send it from a path.
latitudenumberDegrees, -90 to 90. Give longitude too.
longitudenumberDegrees, -180 to 180. Give latitude too.
speednumberMeters per second along a route. Default 15.
waypointsarrayTwo or more [latitude, longitude] pairs to move along over time, interpolated between. "lat,lon" strings are accepted too.

Examples​

Each is the arguments of a tools/call request; the first is shown whole.

Put the device in London​

{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "app_location",
"arguments": {
"latitude": 51.5074,
"longitude": -0.1278
}
}
}

On an Android 15 emulator the answer's text was:

the device is at 51.507400,-0.127800, injected and read back

mobium location 51.5074 -0.1278 on an Android 15 emulator

mobium location 51.5074 -0.1278 on an Android 15 emulator

Give it back its own position​

{
"clear": true
}

On an Android 15 emulator the answer's text was:

the test provider is removed — the device will report its own position the next time something asks for one. Its last known location is still the injected one until then; Android keeps that cache and nothing here can clear it