simulatorIdFromPath function

  1. @visibleForTesting
String? simulatorIdFromPath(
  1. String path
)

The simulator UDID in an app sandbox path, such as .../CoreSimulator/Devices/<UDID>/data/..., or null when it isn't in a simulator.

Implementation

@visibleForTesting
String? simulatorIdFromPath(String path) => RegExp(
  r'/CoreSimulator/Devices/([0-9A-Fa-f-]{36})/',
).firstMatch(path)?.group(1);