set-simulator-location
set-simulator-location copied to clipboard
Not working on Github Actions CI
I'm trying to use set-simulator-location
for testing behaviour on CI using Detox. It works fine when running locally, but does not work at all when running on Github Actions CI.
Has anyone encountered this? Is it a known limitation or is there some build configuration that is necessary to enable location setting on CI servers?
Is the simulator app launched? if not you might try that
Yes it has launched & I've confirmed by finding the simulator with the same ID marked as 'booted' with simctl
.
Any thoughts on things I can try to help debug this?
The tool relies on DistributedNotificationCenter, I've seen some older reports that indicate that it might not be working on recent macOS versions, for example: https://developer.apple.com/forums/thread/129437
Not sure if your issue would be the same as that one but worth exploring around it.
Thanks @triztian. Theoretically the version of MacOS that is running the the Github Actions container is the same as what I'm running locally, but I'll check this out to see if anything others have reported here can help debug better.
I think I am noticing the same thing on my Detox setup, which is using TeamCity rather than Github Actions CI. Works locally, but not on the build system.
Any ideas what could be different between the local build and the CI system?
Same issue on Azure Pipelines machines. Has anyone found a solution already?
I am working on Jenkins. Before the set-simulator-location command, you must specify the path to the executable file. Example below: PATH="/Users/jenkins:$PATH" set-simulator-location -c 66.940231 10.317264
You should try Xcode 14's new feature for this, maybe it doesn't have this issue:
% xcrun simctl location
Control a device's simulated location
Usage: simctl location <device> <action> [arguments]
list
List available simulation scenarios.
clear
Stop any running scenario and clear any simulated location.
set <lat1>,<lon1>
Set the location to a specific latitude and longitude.
run <scenario>
Run a simulated location scenario (use the list action to get a list of scenarios).
start [--speed=<meters/sec>] [--distance=<meters per second>|--interval=<seconds>] <lat1>,<lon1> <latN>,<lonN>...
Set the location to a series of waypoints specified as 'lat,lon' pairs, interpolating between them over time.
At least two waypoints are required. Use '-' to read waypoints from stdin, one waypoint per line.
Speed specifies how quickly to move between waypoints in meters per second. If not specified 20m/s is used.
The system will issue location updates along the path between each pair of waypoints. Use distance or interval to
control how often those updates are issued. Distance will issue an update every <meters> travelled without regard
for the time between updates. Interval will issue updates at fixed times without regard for how much
the location moves between updates.
If neither are specified an interval of 1.0 seconds is used. If both are specified the system picks ones.
Example simulating a direct line between San Francisco and New York City, with updates every km:
set --distance=1000 --speed=260 37.629538,-122.395733 40.628083,-73.768254
Latitude and longitude pairs must be specified using '.' as the decimal separator and ',' as the field separator.