diff --git a/packages/flutter_tools/lib/src/ios/code_signing.dart b/packages/flutter_tools/lib/src/ios/code_signing.dart index 0b3ed8e97b..be172f8c1f 100644 --- a/packages/flutter_tools/lib/src/ios/code_signing.dart +++ b/packages/flutter_tools/lib/src/ios/code_signing.dart @@ -17,63 +17,67 @@ import '../globals.dart'; /// /// The user likely never did any iOS development. const String noCertificatesInstruction = ''' -═══════════════════════════════════════════════════════════════════════════════════ +════════════════════════════════════════════════════════════════════════════════ No valid code signing certificates were found -You can connect to your Apple Developer account by signing in with your Apple ID in Xcode -and create an iOS Development Certificate as well as a Provisioning Profile for your project by: +You can connect to your Apple Developer account by signing in with your Apple ID +in Xcode and create an iOS Development Certificate as well as a Provisioning +Profile for your project by: $fixWithDevelopmentTeamInstruction 5- Trust your newly created Development Certificate on your iOS device via Settings > General > Device Management > [your new certificate] > Trust For more information, please visit: - https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html + https://developer.apple.com/library/content/documentation/IDEs/Conceptual/ + AppDistributionGuide/MaintainingCertificates/MaintainingCertificates.html Or run on an iOS simulator without code signing -═══════════════════════════════════════════════════════════════════════════════════'''; +════════════════════════════════════════════════════════════════════════════════'''; /// User message when there are no provisioning profile for the current app bundle identifier. /// /// The user did iOS development but never on this project and/or device. const String noProvisioningProfileInstruction = ''' -═══════════════════════════════════════════════════════════════════════════════════ -No Provisioning Profile was found for your project's Bundle Identifier or your device. -You can create a new Provisioning Profile for your project in Xcode for your -team by: +════════════════════════════════════════════════════════════════════════════════ +No Provisioning Profile was found for your project's Bundle Identifier or your +device. You can create a new Provisioning Profile for your project in Xcode for +your team by: $fixWithDevelopmentTeamInstruction -It's also possible that a previously installed app with the same Bundle Identifier was -signed with a different certificate. +It's also possible that a previously installed app with the same Bundle +Identifier was signed with a different certificate. For more information, please visit: https://flutter.io/setup/#deploy-to-ios-devices Or run on an iOS simulator without code signing -═══════════════════════════════════════════════════════════════════════════════════'''; +════════════════════════════════════════════════════════════════════════════════'''; /// Fallback error message for signing issues. /// /// Couldn't auto sign the app but can likely solved by retracing the signing flow in Xcode. const String noDevelopmentTeamInstruction = ''' -═══════════════════════════════════════════════════════════════════════════════════ -Building a deployable iOS app requires a selected Development Team with a Provisioning Profile -Please ensure that a Development Team is selected by: +════════════════════════════════════════════════════════════════════════════════ +Building a deployable iOS app requires a selected Development Team with a +Provisioning Profile. Please ensure that a Development Team is selected by: $fixWithDevelopmentTeamInstruction For more information, please visit: https://flutter.io/setup/#deploy-to-ios-devices Or run on an iOS simulator without code signing -═══════════════════════════════════════════════════════════════════════════════════'''; +════════════════════════════════════════════════════════════════════════════════'''; const String fixWithDevelopmentTeamInstruction = ''' 1- Open the Flutter project's Xcode target with open ios/Runner.xcworkspace 2- Select the 'Runner' project in the navigator then the 'Runner' target in the project settings - 3- In the 'General' tab, make sure a 'Development Team' is selected. You may need to + 3- In the 'General' tab, make sure a 'Development Team' is selected. + You may need to: - Log in with your Apple ID in Xcode first - Ensure you have a valid unique Bundle ID - Register your device with your Apple Developer Account - Let Xcode automatically provision a profile for your app 4- Build or run your project again'''; + final RegExp _securityFindIdentityDeveloperIdentityExtractionPattern = new RegExp(r'^\s*\d+\).+"(.+Developer.+)"$'); final RegExp _securityFindIdentityCertificateCnExtractionPattern = new RegExp(r'.*\(([a-zA-Z0-9]+)\)'); diff --git a/packages/flutter_tools/test/ios/mac_test.dart b/packages/flutter_tools/test/ios/mac_test.dart index 3772ab2a5d..21ac363f3f 100644 --- a/packages/flutter_tools/test/ios/mac_test.dart +++ b/packages/flutter_tools/test/ios/mac_test.dart @@ -270,7 +270,7 @@ Error launching application on iPhone.''', await diagnoseXcodeBuildFailure(buildResult); expect( testLogger.errorText, - contains('No Provisioning Profile was found for your project\'s Bundle Identifier or your device.'), + contains('No Provisioning Profile was found for your project\'s Bundle Identifier or your \ndevice.'), ); }); @@ -351,7 +351,7 @@ Could not build the precompiled application for the device.''', await diagnoseXcodeBuildFailure(buildResult); expect( testLogger.errorText, - contains('Building a deployable iOS app requires a selected Development Team with a Provisioning Profile'), + contains('Building a deployable iOS app requires a selected Development Team with a \nProvisioning Profile.'), ); }); });