ios_workflow.dart 1.16 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 6 7
import 'package:meta/meta.dart';

import '../base/platform.dart';
8
import '../doctor.dart';
9 10
import '../features.dart';
import '../macos/xcode.dart';
11

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

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

25
  @override
26
  bool get appliesToHostPlatform => _featureFlags.isIOSEnabled && _platform.isMacOS;
27

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

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

37 38
  @override
  bool get canListEmulators => false;
39
}