openSimulatorArguments static method

List<String> openSimulatorArguments({
  1. required String uuid,
  2. required String? appPath,
})

open arguments for appPath.

Simulator.app focuses a device with -CurrentDeviceUDID. DeviceHub.app does not take that flag; simctl boot already selected the device.

Implementation

static List<String> openSimulatorArguments({
  required String uuid,
  required String? appPath,
}) {
  final app = appPath ?? 'Simulator';
  final args = <String>['-a', app];
  final isDeviceHub =
      appPath != null && p.posix.basename(appPath) == 'DeviceHub.app';
  if (!isDeviceHub) {
    args.addAll(['--args', '-CurrentDeviceUDID', uuid]);
  }
  return args;
}