ios_workflow.dart 1.14 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5
import '../base/platform.dart';
6
import '../doctor_validator.dart';
7 8
import '../features.dart';
import '../macos/xcode.dart';
9

10
class IOSWorkflow implements Workflow {
11
  const IOSWorkflow({
12 13 14
    required Platform platform,
    required FeatureFlags featureFlags,
    required Xcode xcode,
15 16 17 18 19 20 21
  }) : _platform = platform,
       _featureFlags = featureFlags,
       _xcode = xcode;

  final Platform _platform;
  final FeatureFlags _featureFlags;
  final Xcode _xcode;
22

23
  @override
24
  bool get appliesToHostPlatform => _featureFlags.isIOSEnabled && _platform.isMacOS;
25

26
  // We need xcode (+simctl) to list simulator devices, and libimobiledevice to list real devices.
27
  @override
28
  bool get canListDevices => appliesToHostPlatform && _xcode.isSimctlInstalled;
29

30
  // We need xcode to launch simulator devices, and ios-deploy
31
  // for real devices.
32
  @override
33
  bool get canLaunchDevices => appliesToHostPlatform && _xcode.isInstalledAndMeetsVersionCheck;
34

35 36
  @override
  bool get canListEmulators => false;
37
}