Spoofs the device location from the dev machine.
Useful when testing Dala.Platform.Location without physically moving:
pin the device to a specific café, a different hemisphere, or the exact
geofence boundary.
Platform support:
- Android emulator —
adb emu geo fix(physical devices need a mock location provider app, which is out of scope) - iOS Simulator —
xcrun simctl location ... set
Summary
Functions
adb argument list that sets the Android emulator's location.
Clears any spoofed location on device_id (or the first connected device).
xcrun argument list that clears a simulator's spoofed location.
xcrun argument list that sets an iOS simulator's location.
Parses "lat,lng" (or with spaces, or "lat lng") into floats.
Returns {:ok, lat, lng} or {:error, reason}. Validates ranges
(|lat| <= 90, |lng| <= 180).
Sets the location on one device (device_id nil = first connected).
Types
Functions
adb argument list that sets the Android emulator's location.
Clears any spoofed location on device_id (or the first connected device).
xcrun argument list that clears a simulator's spoofed location.
xcrun argument list that sets an iOS simulator's location.
Parses "lat,lng" (or with spaces, or "lat lng") into floats.
Returns {:ok, lat, lng} or {:error, reason}. Validates ranges
(|lat| <= 90, |lng| <= 180).
Sets the location on one device (device_id nil = first connected).
Test seams: opts[:devices] overrides discovery; opts[:exec] overrides
command execution — receives tagged {:adb, args} / {:xcrun, args} and
returns {:ok, out} or {:error, out}.