Add brew update step before install/upgrade (#8703)

This avoids unintentionally installing an older version if the
developer's homebrew installation is out-of-date.
diff --git a/packages/flutter_tools/lib/src/ios/devices.dart b/packages/flutter_tools/lib/src/ios/devices.dart
index a5d68df..f9e274d 100644
--- a/packages/flutter_tools/lib/src/ios/devices.dart
+++ b/packages/flutter_tools/lib/src/ios/devices.dart
@@ -21,8 +21,9 @@
 import 'mac.dart';
 
 const String _kIdeviceinstallerInstructions =
-    'To work with iOS devices, please install ideviceinstaller.\n'
-    'To install, run \'brew install ideviceinstaller\'.';
+    'To work with iOS devices, please install ideviceinstaller. To install, run:\n'
+    'brew update\n'
+    'brew install ideviceinstaller.';
 
 const Duration kPortForwardTimeout = const Duration(seconds: 10);
 
@@ -48,6 +49,7 @@
     _pusherPath = _checkForCommand(
         'ios-deploy',
         'To copy files to iOS devices, please install ios-deploy. To install, run:\n'
+        'brew update\n'
         'brew install ios-deploy');
   }
 
diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart
index fbcd723..0a077ce 100644
--- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart
+++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart
@@ -120,6 +120,7 @@
         messages.add(new ValidationMessage.error(
           'ideviceinstaller not available; this is used to discover connected iOS devices.\n'
           'To install, run:\n'
+          'brew update\n'
           'brew install --HEAD libimobiledevice\n'
           'brew install ideviceinstaller'
         ));
@@ -133,12 +134,15 @@
         brewStatus = ValidationType.partial;
         if (hasIosDeploy) {
           messages.add(new ValidationMessage.error(
-            'ios-deploy out of date ($iosDeployMinimumVersion is required): '
-            'upgrade via \'brew upgrade ios-deploy\'.'
+            'ios-deploy out of date ($iosDeployMinimumVersion is required). To upgrade:\n'
+            'brew update\n'
+            'brew upgrade ios-deploy'
           ));
         } else {
           messages.add(new ValidationMessage.error(
-            'ios-deploy not installed: install via \'brew install ios-deploy\'.'
+            'ios-deploy not installed. To install:\n'
+            'brew update\n'
+            'brew install ios-deploy'
           ));
         }
       } else {
@@ -149,6 +153,7 @@
           brewStatus = ValidationType.partial;
           messages.add(new ValidationMessage.error(
             'libimobiledevice is incompatible with the installed Xcode version. To update, run:\n'
+            'brew update\n'
             'brew uninstall --ignore-dependencies libimobiledevice\n'
             'brew install --HEAD libimobiledevice'
           ));