Prevent "install XCode" dialog when flutter doctor is run (#6164)

fixes https://github.com/flutter/flutter/issues/6163
diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart
index d180827..ebe9ded 100644
--- a/packages/flutter_tools/lib/src/ios/mac.dart
+++ b/packages/flutter_tools/lib/src/ios/mac.dart
@@ -28,6 +28,10 @@
 
     try {
       _xcodeSelectPath = runSync(<String>['xcode-select', '--print-path']);
+      if (_xcodeSelectPath == null || _xcodeSelectPath.trim().isEmpty) {
+        _isInstalled = false;
+        return;
+      }
       _isInstalled = true;
 
       _xcodeVersionText = runSync(<String>['xcodebuild', '-version']).replaceAll('\n', ', ');