location · setLocation · clearLocation · followRoute · followGpx
This tool on every surface: CLI · MCP · Python · JavaScript · Go · Java · .NET
Read where the device believes it is, or place it somewhere. These call app_location.
location
public Location location()
Where the device believes it is.
mock says this fix was injected; mocking says a test
provider is installed now. They differ after clearLocation(),
because Android keeps the last known position after the provider that
supplied it is gone.
Android only. simctl location has no get, so on iOS
this throws rather than returning a position it never read.
@return the position, and whether it was injected
setLocation
public void setLocation(double latitude, double longitude)
Places the device at a coordinate.
On Android this goes through a test provider, is read back, and works on real hardware. On iOS it goes through simctl and cannot be confirmed: returning means the request was accepted, not that an app will read it.
@param latitude in degrees, north positive @param longitude in degrees, east positive
clearLocation
public void clearLocation()
Removes the injected position. Does not clear the device's last known location, which Android caches.
followRoute
public void followRoute(List<double[]> waypoints, double speedMPS)
Moves along two or more waypoints over time, each a
{latitude, longitude} pair, at speedMPS meters per
second — pass 0 for the default.
On iOS the simulator interpolates the route itself; on Android the daemon steps a test provider once a second, the platform having no route command. Either way this returns as the route starts.
@param waypoints two or more {latitude, longitude} pairs, in degrees
@param speedMPS meters per second, or 0 for the default
followGpx
public void followGpx(String path, double speedMPS)
Follows a GPX file, read on the machine running the daemon.
@param path the GPX file, on the machine running the daemon @param speedMPS meters per second, or 0 for the default
Examples
Put the device in London
device.setLocation(51.5074, -0.1278);
The same call from the command line, mobium location 51.5074 -0.1278, printed on an Android 15 emulator:
the device is at 51.507400,-0.127800, injected and read back

mobium location 51.5074 -0.1278 on an Android 15 emulator
Give it back its own position
device.clearLocation();
The same call from the command line, mobium location --clear, printed on an Android 15 emulator:
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