Skip to main content
Give a session a fixed GPS position so that apps using Core Location, the Android location APIs, expo-location, or a web page’s Geolocation API see that point. It works on iOS Simulator and Android Emulator through the CLI, the TypeScript SDK, and the REST API. On iOS the host runs simctl location set; on Android it sends geo fix to the emulator console. The call returns once the device has accepted the fix.

Use the CLI

Negative coordinates work as written: --latitude -33.8568 --longitude 151.2153.

Use the TypeScript SDK

setLocation checks the coordinates before it sends anything, and throws a TypeError if they are out of range.

Use the REST API

Replace ios with android for an emulator session. A successful reply:

Clearing

Behavior

  • The location stays set until you change or clear it, or until the session ends.
  • The app still needs location permission. Grant it in the app’s prompt, or through Settings on the device.
  • Setting a location does not change the time zone, locale, or the IP-based location that web services infer.

Errors

Failures return ok: false, action: "location", and error.code: