-
Notifications
You must be signed in to change notification settings - Fork 29.8k
flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing #177888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing #177888
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request enhances flutter build ipa to automatically generate a complete ExportOptions.plist for manual code signing configurations. This is a significant improvement for developers using manual signing, especially for apps with entitlements like Push Notifications. The changes include adding logic to detect manual signing, find the correct provisioning profile, and generate an enhanced plist with the necessary signing information. The implementation includes robust fallback mechanisms and extensive logging. New unit tests have been added to cover the new logic, and existing tests are updated. The code is well-documented and follows good practices for testability and maintainability. I have a couple of minor suggestions for improving code style and readability.
…est practices - Simplify FakeXcodeProjectInterpreter.getBuildSettings by defining defaults first, then spreading overrides (eliminates redundant ?? operators) - Replace listSync() with await for (using list()) in _findProvisioningProfileUuid for better asynchronous code style and non-blocking file system operations Addresses code review feedback from PR flutter#177888
…iene Add comments directly above skip parameters explaining why integration tests are skipped. This satisfies Flutter's tree hygiene requirement that all skipped tests must have justification comments. Fixes CI failure in PR flutter#177888
…est practices - Simplify FakeXcodeProjectInterpreter.getBuildSettings by defining defaults first, then spreading overrides (eliminates redundant ?? operators) - Replace listSync() with await for (using list()) in _findProvisioningProfileUuid for better asynchronous code style and non-blocking file system operations Addresses code review feedback from PR flutter#177888
…iene Add comments directly above skip parameters explaining why integration tests are skipped. This satisfies Flutter's tree hygiene requirement that all skipped tests must have justification comments. Fixes CI failure in PR flutter#177888
8d1771c to
959303b
Compare
…est practices - Simplify FakeXcodeProjectInterpreter.getBuildSettings by defining defaults first, then spreading overrides (eliminates redundant ?? operators) - Replace listSync() with await for (using list()) in _findProvisioningProfileUuid for better asynchronous code style and non-blocking file system operations Addresses code review feedback from PR flutter#177888
…iene Add comments directly above skip parameters explaining why integration tests are skipped. This satisfies Flutter's tree hygiene requirement that all skipped tests must have justification comments. Fixes CI failure in PR flutter#177888
cfd6ca6 to
0ac20f1
Compare
…est practices - Simplify FakeXcodeProjectInterpreter.getBuildSettings by defining defaults first, then spreading overrides (eliminates redundant ?? operators) - Replace listSync() with await for (using list()) in _findProvisioningProfileUuid for better asynchronous code style and non-blocking file system operations Addresses code review feedback from PR flutter#177888
…iene Add comments directly above skip parameters explaining why integration tests are skipped. This satisfies Flutter's tree hygiene requirement that all skipped tests must have justification comments. Fixes CI failure in PR flutter#177888
f9b8aa3 to
a10a5f0
Compare
028bcb9 to
b3a900b
Compare
…est practices - Simplify FakeXcodeProjectInterpreter.getBuildSettings by defining defaults first, then spreading overrides (eliminates redundant ?? operators) - Replace listSync() with await for (using list()) in _findProvisioningProfileUuid for better asynchronous code style and non-blocking file system operations Addresses code review feedback from PR flutter#177888
b3a900b to
7c71a1f
Compare
…iene Add comments directly above skip parameters explaining why integration tests are skipped. This satisfies Flutter's tree hygiene requirement that all skipped tests must have justification comments. Fixes CI failure in PR flutter#177888
vashworth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution! Overall the concept sounds good to me. I left some comments on tweaking the implementation to make it more testable.
packages/flutter_tools/test/commands.shard/hermetic/build_ipa_export_plist_test.dart
Outdated
Show resolved
Hide resolved
packages/flutter_tools/test/commands.shard/hermetic/build_ipa_test.dart
Outdated
Show resolved
Hide resolved
a9e070d to
7c71a1f
Compare
|
An existing Git SHA, To re-trigger presubmits after closing or re-opeing a PR, or pushing a HEAD commit (i.e. with |
- Remove design decision comment from BuildIOSArchiveCommand class doc - Remove empty integration test placeholders (move rationale to PR description) - Remove redundant buildInfo declaration (line 575) - Make createExportPlist public with buildSettings parameter - Fetch buildSettings at call site and pass to public method - Remove test-only createExportPlistForTesting method - Remove unnecessary private wrapper methods - Update tests to use public createExportPlist method via command instance - Update all tests to pass buildSettings instead of individual parameters Follows Flutter's style guide: test APIs belong in test frameworks, not in the codebase.
- Remove design decision comment from BuildIOSArchiveCommand class doc - Remove empty integration test placeholders (move rationale to PR description) - Remove redundant buildInfo declaration (line 575) - Make createExportPlist public with buildSettings parameter - Fetch buildSettings at call site and pass to public method - Remove test-only createExportPlistForTesting method - Remove unnecessary private wrapper methods - Update tests to use public createExportPlist method via command instance - Update all tests to pass buildSettings instead of individual parameters Follows Flutter's style guide: test APIs belong in test frameworks, not in the codebase.
4070b45 to
afa4f9a
Compare
- Remove design decision comment from BuildIOSArchiveCommand class doc - Remove empty integration test placeholders (move rationale to PR description) - Remove redundant buildInfo declaration (line 575) - Make createExportPlist public with buildSettings parameter - Fetch buildSettings at call site and pass to public method - Remove test-only createExportPlistForTesting method - Remove unnecessary private wrapper methods - Update tests to use public createExportPlist method via command instance - Update all tests to pass buildSettings instead of individual parameters Follows Flutter's style guide: test APIs belong in test frameworks, not in the codebase.
|
autosubmit label was removed for flutter/flutter/177888, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR. |
Roll Flutter from 01d37bc to 73769a2 (65 revisions) flutter/flutter@01d37bc...73769a2 2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from 5e855c2bb3ef to 87fbfd5381b6 (1 revision) (flutter/flutter#180800) 2026-01-10 engine-flutter-autoroll@skia.org Roll Skia from b2b109f0e980 to f39cc645b1dd (2 revisions) (flutter/flutter#180796) 2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from b7963905e6a2 to 5e855c2bb3ef (2 revisions) (flutter/flutter#180794) 2026-01-10 ahmedsameha1@gmail.com Make sure that a CupertinoTabScaffold doesn't crash in 0x0 environment (flutter/flutter#179824) 2026-01-10 engine-flutter-autoroll@skia.org Roll Dart SDK from d25ad331b7ea to b7963905e6a2 (2 revisions) (flutter/flutter#180783) 2026-01-10 ahmedsameha1@gmail.com Make sure that a Container doesn't crash in 0x0 environment (flutter/flutter#180350) 2026-01-10 ahmedsameha1@gmail.com Make sure that an Expansible doesn't crash in 0x0 environment (flutter/flutter#180478) 2026-01-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Enabled some disabled impeller fragment shader dart tests (#180759)" (flutter/flutter#180785) 2026-01-09 dkwingsmt@users.noreply.github.com Merge `widget_tester_leaks_free_test.dart` into `widget_tester_test.dart` (flutter/flutter#180600) 2026-01-09 codefu@google.com fix: there are no riscv fuchsia artifacts (flutter/flutter#180779) 2026-01-09 engine-flutter-autoroll@skia.org Roll Skia from 7386219151e6 to b2b109f0e980 (1 revision) (flutter/flutter#180771) 2026-01-09 chinmaygarde@google.com Re-prioritize pipeline compile jobs and perform them eagerly instead of waiting. (flutter/flutter#180022) 2026-01-09 30870216+gaaclarke@users.noreply.github.com Enabled some disabled impeller fragment shader dart tests (flutter/flutter#180759) 2026-01-09 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from rxeg-6UB678HKJ4UQ... to 83Favz_zzMzdVuOHg... (flutter/flutter#180765) 2026-01-09 jhy03261997@gmail.com [A11y ] Add `clearSemantics`in table (flutter/flutter#180665) 2026-01-09 chinmaygarde@google.com Update CODEOWNERS to remove chinmaygarde. (flutter/flutter#180703) 2026-01-09 vhaudiquet343@hotmail.fr [ Tool ] Add support for linux riscv64 architecture (flutter/flutter#178711) 2026-01-09 engine-flutter-autoroll@skia.org Roll Skia from e9b3264ade0c to 7386219151e6 (12 revisions) (flutter/flutter#180754) 2026-01-09 engine-flutter-autoroll@skia.org Roll Dart SDK from fe2ba2c5dd50 to d25ad331b7ea (10 revisions) (flutter/flutter#180741) 2026-01-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Unpin google_mobile_ads (#180573)" (flutter/flutter#180761) 2026-01-09 koichi20021217@gmail.com Fix typo in dropdown_menu.dart (flutter/flutter#180172) 2026-01-09 engine-flutter-autoroll@skia.org Roll Packages from 039a026 to 51fe1d9 (1 revision) (flutter/flutter#180742) 2026-01-09 goderbauer@google.com Unpin google_mobile_ads (flutter/flutter#180573) 2026-01-09 evanwall@buffalo.edu Update flutter changelog for 3.38.6 (flutter/flutter#180708) 2026-01-08 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Fix iOS xattr removal to clear all extended attributes (#180355)" (flutter/flutter#180709) 2026-01-08 ahmedsameha1@gmail.com Make sure that an EditableText doesn't crash in 0x0 environment (flutter/flutter#180457) 2026-01-08 matt.kosarek@canonical.com Implementation of tooltip windows for win32 (flutter/flutter#179147) 2026-01-08 mdebbar@google.com [web] Don't serve files outside of project (flutter/flutter#180699) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 837be28dd218 to e9b3264ade0c (1 revision) (flutter/flutter#180702) 2026-01-08 sokolovskyi.konstantin@gmail.com Add new motion accessibility features to iOS. (flutter/flutter#178102) 2026-01-08 104009581+Saqib198@users.noreply.github.com Fix iOS xattr removal to clear all extended attributes (flutter/flutter#180355) 2026-01-08 bkonyi@google.com [ Widget Preview ] Move widget_preview_scaffold tests to `dev/integration_tests/widget_preview_scaffold` (flutter/flutter#180658) 2026-01-08 30870216+gaaclarke@users.noreply.github.com De-interleaves engine dart test output (flutter/flutter#180651) 2026-01-08 zhongliu88889@gmail.com [web] Fix SemanticsService.announce not working inside dialogs (flutter/flutter#179958) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 42233226ac56 to 837be28dd218 (2 revisions) (flutter/flutter#180693) 2026-01-08 iinozemtsev@google.com Roll Dart SDK to 3.11.0-296.2.beta (flutter/flutter#180685) 2026-01-08 116356835+AbdeMohlbi@users.noreply.github.com Improve code quality in `AndroidTouchProcessorTest.java` (flutter/flutter#180583) 2026-01-08 1961493+harryterkelsen@users.noreply.github.com Revert "Reverts "[reland] Unify canvas creation and Surface code in S…kwasm and CanvasKit (#179473)" (#180152)" (flutter/flutter#180610) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from a0c407bce408 to 42233226ac56 (4 revisions) (flutter/flutter#180688) 2026-01-08 bkonyi@google.com [ Tool ] Fix flake in overall_experience_test.dart (flutter/flutter#180655) 2026-01-08 engine-flutter-autoroll@skia.org Roll Packages from 9705815 to 039a026 (6 revisions) (flutter/flutter#180684) 2026-01-08 104147021+MohammedTarigg@users.noreply.github.com flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing (flutter/flutter#177888) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 58837e160874 to a0c407bce408 (2 revisions) (flutter/flutter#180679) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 1e3266fdba86 to 58837e160874 (1 revision) (flutter/flutter#180677) 2026-01-08 engine-flutter-autoroll@skia.org Roll Skia from 3c47ea10638f to 1e3266fdba86 (4 revisions) (flutter/flutter#180675) 2026-01-08 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from dTvN_JVSCfGFRasvH... to rxeg-6UB678HKJ4UQ... (flutter/flutter#180673) ...
flutter_tools: Auto-generate ExportOptions.plist for manual iOS code signing
Summary
Enhance
flutter build ipato automatically generate a complete ExportOptions.plist for manual code signing configurations, eliminating the need for users to create and maintain one manually.Fixes: #177853
Problem
When using manual code signing (
CODE_SIGN_STYLE=Manual) withflutter build ipafor Release/Profile builds, the archive succeeds but the export step fails with:Root cause: Flutter generated an incomplete ExportOptions.plist that only included
methodanduploadBitcode. When using manual signing,xcodebuild -exportArchiverequires:teamID(from project'sDEVELOPMENT_TEAM)signingStyle=manualprovisioningProfiles(mapping bundle ID to provisioning profile UUID)Without these, Xcode cannot resolve the provisioning profile for export, even if the profile is correctly configured and contains the required entitlements.
Solution
Enhanced
_createExportPlist()inBuildIOSArchiveCommandto automatically generate a complete ExportOptions.plist when:CODE_SIGN_STYLE=Manualis detected for the main app targetThe generated plist includes:
method(app-store, ad-hoc, enterprise, etc. - respects user's--export-methodflag)teamID(fromDEVELOPMENT_TEAMbuild setting)signingStyle=manualprovisioningProfilesmapping main app bundle ID to provisioning profile UUIDFallback behavior:
Changes
Core Implementation
ProfileDataclass to encapsulate provisioning profile info (UUID and name)_createExportPlist()with manual signing detection and profile lookup_findProvisioningProfileUuid()to locate provisioning profiles by specifier_parseProvisioningProfileInfo()to decode provisioning profile data onceTesting
build_ipa_export_plist_test.dartwith 7 unit tests covering:Documentation
Added extensive inline comments explaining:
Safety & Scope
What This Fixes
--export-options-plistworkaroundWhat This Does NOT Change
Known Limitations (Future Enhancements)
Pre-merge Checklist
flutter test packages/flutter_tools)dart analyze)Safety Notes
flutter build ipafor Release/Profile buildsVerification
Users can verify the fix by:
CODE_SIGN_STYLE=Manual,DEVELOPMENT_TEAMset, and Push Notifications entitlementsflutter build ipa --release --verbose--export-options-plistRelated Issues
flutter build ipawith manual signing and provisioning profiles #106612 - Supportflutter build ipawith manual signing and provisioning profiles