setLocation
suspend fun setLocation(latitude: Double, longitude: Double, accuracyM: Float? = null, altitudeM: Double? = null)(source)
Mocks the device location until detach: the gps and network providers (and fused, API 31+) report this fix, sent again every second so an app that starts listening later still gets one. latitude -90..90, longitude -180..180, accuracyM in meters (> 0; null = 5), altitudeM in meters (null = none). The Tap driver app becomes the device's mock-location app and, when location is off, location is turned on; both are restored on detach, which ends the mock. Calling it again moves the fix. Apps that read location through Google Play services see it as Play services relays the platform providers.