isAppInstalled static method

Future<bool> isAppInstalled(
  1. String bundleIdentifier,
  2. String? simulatorId
)

Check if app is installed on simulator

Implementation

static Future<bool> isAppInstalled(
  String bundleIdentifier,
  String? simulatorId,
) async {
  try {
    final simId = simulatorId ?? 'booted';
    final result = await Process.run('xcrun', [
      'simctl',
      'get_app_container',
      simId,
      bundleIdentifier,
    ]);
    return result.exitCode == 0;
  } catch (e) {
    return false;
  }
}