From e33e4f0476bd613502fb1724b3996f09b25fb01e Mon Sep 17 00:00:00 2001 From: Krzysztof Czarnota Date: Wed, 22 Jan 2025 19:54:08 +0100 Subject: [PATCH] Enabled provisioning updates and device registration during building xcarchive. (#159622) Provisioning updates and device registration were disabled when development team was specified in the xcode project. This lead to build error when provisioning profile was not present. Now provisioning updates and device registration are enabled when tool builds codesigned archive. This will allow to build the iOS version of app without launching xcode in order to enforce provisioning profile updates. Issues fixed by this PR. * https://github.com/flutter/flutter/issues/139212 * https://github.com/flutter/flutter/issues/113977 * https://github.com/flutter/flutter/issues/121702 (partly because author asks for possibility of passing xcode flags like allowProvisioningUpdates) ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [X] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] All existing and new tests are passing. --- packages/flutter_tools/lib/src/ios/mac.dart | 3 +++ .../test/commands.shard/hermetic/build_ios_test.dart | 2 ++ .../test/commands.shard/hermetic/build_ipa_test.dart | 2 ++ .../general.shard/ios/ios_device_start_nonprebuilt_test.dart | 4 ++++ 4 files changed, 11 insertions(+) diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index dba3560a09..33eeed3bf7 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -315,6 +315,9 @@ Future buildXcodeProject({ for (final MapEntry signingConfig in autoSigningConfigs.entries) { buildCommands.add('${signingConfig.key}=${signingConfig.value}'); } + } + + if (codesign) { buildCommands.add('-allowProvisioningUpdates'); buildCommands.add('-allowProvisioningDeviceRegistration'); } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart index fd7ec49cb7..9befd460d8 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ios_test.dart @@ -167,6 +167,8 @@ void main() { '-configuration', if (simulator) 'Debug' else 'Release', if (verbose) 'VERBOSE_SCRIPT_LOGGING=YES' else '-quiet', + '-allowProvisioningUpdates', + '-allowProvisioningDeviceRegistration', '-workspace', if (customNaming) 'RenamedWorkspace.xcworkspace' else 'Runner.xcworkspace', '-scheme', diff --git a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart index 9377f45920..40eb4d8e45 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart @@ -172,6 +172,8 @@ void main() { '-configuration', 'Release', if (verbose) 'VERBOSE_SCRIPT_LOGGING=YES' else '-quiet', + '-allowProvisioningUpdates', + '-allowProvisioningDeviceRegistration', '-workspace', 'Runner.xcworkspace', '-scheme', diff --git a/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart b/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart index 6db5e19c40..f707fbe6d2 100644 --- a/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/ios_device_start_nonprebuilt_test.dart @@ -48,6 +48,8 @@ const List kRunReleaseArgs = [ '-configuration', 'Release', '-quiet', + '-allowProvisioningUpdates', + '-allowProvisioningDeviceRegistration', '-workspace', 'Runner.xcworkspace', '-scheme', @@ -334,6 +336,8 @@ void main() { '-configuration', 'Release', '-quiet', + '-allowProvisioningUpdates', + '-allowProvisioningDeviceRegistration', '-workspace', 'Runner.xcworkspace', '-scheme',