core/simulator_device library

Functions

findSimulator(List<SimulatorDevice> simulators, String udid) → SimulatorDevice?
Returns the simulator in simulators whose UDID matches udid (case-insensitive), or null.
listSimulators() → Future<SimulatorListing>
Lists every simulator known to simctl via simctl list devices -j.
pickSimulatorDevice(List<SimulatorDevice> simulators, {required String? deviceOverride, required String? sessionDevice}) → SimulatorDeviceResolution
Applies the precedence of resolveSimulatorDevice to an already fetched simulators list, so callers that need the list themselves (for example to decide whether a device ID is a simulator at all) list devices only once.
resolveSimulatorDevice({String? deviceOverride}) → Future<SimulatorDeviceResolution>
Resolves the iOS simulator UDID that xcrun simctl commands should target.

Typedefs

SimulatorDevice = ({String name, String runtime, String state, String udid})
One simulator from xcrun simctl list devices -j.
SimulatorDeviceResolution = ({String? error, String? udid})
Outcome of resolveSimulatorDevice: exactly one of udid or error is set.
SimulatorListing = ({String? error, List<SimulatorDevice>? simulators})
Outcome of listSimulators: exactly one of simulators or error is set.