set-simulator-location icon indicating copy to clipboard operation
set-simulator-location copied to clipboard

Not working on Github Actions CI

Open cayleyh opened this issue 3 years ago • 9 comments

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?

cayleyh avatar Jan 04 '21 21:01 cayleyh

Is the simulator app launched? if not you might try that

keith avatar Jan 04 '21 22:01 keith

Yes it has launched & I've confirmed by finding the simulator with the same ID marked as 'booted' with simctl.

cayleyh avatar Jan 04 '21 23:01 cayleyh

Any thoughts on things I can try to help debug this?

cayleyh avatar Jan 06 '21 20:01 cayleyh

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.

triztian avatar Jan 15 '21 10:01 triztian

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.

cayleyh avatar Jan 26 '21 23:01 cayleyh

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?

KatieSnell-TomTom avatar May 26 '21 14:05 KatieSnell-TomTom

Same issue on Azure Pipelines machines. Has anyone found a solution already?

henriquenfaria avatar Feb 08 '22 15:02 henriquenfaria

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

SergeyKrivorotko avatar Jul 18 '22 09:07 SergeyKrivorotko

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.

keith avatar Jan 17 '23 16:01 keith