From e6ed26d6587b0aade8bbc90d4114f26644d22a65 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 28 Sep 2016 10:01:07 -0700 Subject: [PATCH] Doctor check for libimobiledevice/Xcode compatibility (#6111) libimobiledevice 1.2.0 is incompatible with Xcode >= 8.0. Since the libimobiledevice tools don't include a --version flag, check for valid exit code on running idevicename, if an iOS device is connected. --- packages/flutter_tools/lib/src/ios/ios_workflow.dart | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/flutter_tools/lib/src/ios/ios_workflow.dart b/packages/flutter_tools/lib/src/ios/ios_workflow.dart index 9a0c8f57ab..1e79bfad38 100644 --- a/packages/flutter_tools/lib/src/ios/ios_workflow.dart +++ b/packages/flutter_tools/lib/src/ios/ios_workflow.dart @@ -80,6 +80,17 @@ class IOSWorkflow extends DoctorValidator implements Workflow { 'ios-deploy not available; this is used to deploy to connected iOS devices.\n' 'Install via \'brew install ios-deploy\'.' )); + } else { + // Check for compatibility between libimobiledevice and Xcode. + // TODO(cbracken) remove this check once libimobiledevice > 1.2.0 is released. + ProcessResult result = (await runAsync(['idevice_id', '-l'])).processResult; + if (result.exitCode == 0 && result.stdout.isNotEmpty && !exitsHappy(['ideviceName'])) { + messages.add(new ValidationMessage.error( + 'libimobiledevice is incompatible with the installed XCode version. To update, run:\n' + 'brew uninstall libimobiledevice\n' + 'brew install --HEAD libimobiledevice' + )); + } } } else { messages.add(new ValidationMessage.error(