refactor to move an ios specific class out of globals.dart
diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart
index 4a1d047..67eda8d 100644
--- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart
+++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart
@@ -6,7 +6,6 @@
 
 import '../base/process.dart';
 import '../doctor.dart';
-import '../globals.dart';
 import 'mac.dart';
 
 class IOSWorkflow extends Workflow {
@@ -15,11 +14,11 @@
   bool get appliesToHostPlatform => Platform.isMacOS;
 
   // We need xcode (+simctl) to list simulator devices, and idevice_id to list real devices.
-  bool get canListDevices => xcode.isInstalledAndMeetsVersionCheck;
+  bool get canListDevices => XCode.instance.isInstalledAndMeetsVersionCheck;
 
   // We need xcode to launch simulator devices, and ideviceinstaller and ios-deploy
   // for real devices.
-  bool get canLaunchDevices => xcode.isInstalledAndMeetsVersionCheck;
+  bool get canLaunchDevices => XCode.instance.isInstalledAndMeetsVersionCheck;
 
   ValidationResult validate() {
     Validator iosValidator = new Validator(
@@ -28,15 +27,15 @@
     );
 
     ValidationType xcodeExists() {
-      return xcode.isInstalled ? ValidationType.installed : ValidationType.missing;
+      return XCode.instance.isInstalled ? ValidationType.installed : ValidationType.missing;
     };
 
     ValidationType xcodeVersionSatisfactory() {
-      return xcode.isInstalledAndMeetsVersionCheck ? ValidationType.installed : ValidationType.missing;
+      return XCode.instance.isInstalledAndMeetsVersionCheck ? ValidationType.installed : ValidationType.missing;
     };
 
     ValidationType xcodeEulaSigned() {
-      return xcode.eulaSigned ? ValidationType.installed : ValidationType.missing;
+      return XCode.instance.eulaSigned ? ValidationType.installed : ValidationType.missing;
     };
 
     ValidationType brewExists() {
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index 163f6f4..df2ef7d 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -18,15 +18,12 @@
 
 String get homeDirectory => path.absolute(Platform.environment['HOME']);
 
-// TODO(devoncarew): Refactor functionality into XCode.
-
 const int kXcodeRequiredVersionMajor = 7;
 const int kXcodeRequiredVersionMinor = 2;
 
 class XCode {
-  static void initGlobal() {
-    context[XCode] = new XCode();
-  }
+  /// Returns [XCode] active in the current app context.
+  static XCode get instance => context[XCode] ?? (context[XCode] = new XCode());
 
   bool get isInstalledAndMeetsVersionCheck => isInstalled && xcodeVersionSatisfactory;
 
diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart
index d8ea7b7..8323201 100644
--- a/packages/flutter_tools/lib/src/ios/simulators.dart
+++ b/packages/flutter_tools/lib/src/ios/simulators.dart
@@ -38,7 +38,7 @@
   }
 
   List<IOSSimulator> getAttachedDevices() {
-    if (!xcode.isInstalledAndMeetsVersionCheck)
+    if (!XCode.instance.isInstalledAndMeetsVersionCheck)
       return <IOSSimulator>[];
 
     return SimControl.instance.getConnectedDevices().map((SimDevice device) {
@@ -320,7 +320,7 @@
     if (clearLogs)
       this.clearLogs();
 
-    if(!(await _setupUpdatedApplicationBundle(app, toolchain)))
+    if (!(await _setupUpdatedApplicationBundle(app, toolchain)))
       return false;
 
     // Prepare launch arguments.