Simulator Activity Type

I develop some fields that work for both run and cycle Activity Type. My primary user base is cycling. But the sim defaults to run. I'd like to add code that knows when I'm in the simulator and set the Sport Type to cycling, to save time every time I launch the field for testing/dev. Any way to do this?

  • I'd like to add code that knows when I'm in the simulator and set the Sport Type to cycling

    I feel like you're asking for two things here:

    - you want your *app* to know when it's running in the sim

    - you want the simulator to somehow automatically set the sport type to cycling under certain conditions

    I say it's two things because CIQ apps can't do anything to influence simulator settings as far as I know (apps aren't even supposed to know whether they're running in the sim or not).

    I don't think it's possible, unfortunately. Even if your app could know whether it's running in the sim (a few hacks have been proposed), the app still wouldn't be able to change the simulator's settings.

    I think the best you can do define a wrapper function which returns the sport type and has different implementations depending on which of the :debug or :release annotations is defined. For debug builds, it would always return the cycling sport type. For release builds it would return the actual sport type, via the CIQ API. Whenever your app needs to know the sport type, it calls the wrapper function instead of directly using the CIQ API.

  • What device are you running on in the sim? I'd say if it's an edge, then it would make sense to change the default activity type to cycling. Maybe it would make sense to open a bug/feature request.

  • I'd say if it's an edge, then it would make sense to change the default activity type to cycling

    Yeah I think it’s safe to say that 0% of edge users take their device on runs. And even if they did, it’s doubtful the edge even has a built-in run activity. (I see people complaining that there’s no hiking activity on the edge…)