[msbuild] Embed the app's symbols in the .ipa (IpaIncludeSymbols)#26043
[msbuild] Embed the app's symbols in the .ipa (IpaIncludeSymbols)#26043rolfbjarne wants to merge 2 commits into
Conversation
Apple's App Store Connect (and Xcode's Organizer) can only symbolicate crash reports automatically when the .ipa contains a top-level 'Symbols' directory with the *.symbols files Apple expects. Xcode generates these via 'xcrun symbols'; our build never produced them, so uploaded apps showed up as missing symbols. Add a new opt-in 'IpaIncludeSymbols' MSBuild property (default false). When enabled, a new '_CreateIpaSymbols' target runs the new 'CreateSymbolsPackage' task, which invokes 'xcrun symbols' over each dSYM's DWARF binary to produce the *.symbols files, and adds the resulting 'Symbols' directory to the .ipa. Fixes #17807 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Enable IpaIncludeSymbols by default whenever BuildIpa is true, so apps get their symbols embedded in the .ipa (and thus symbolicated crash reports on App Store Connect) out of the box. Set IpaIncludeSymbols=false to opt out. The default is computed in the targets (where BuildIpa is resolved) rather than in the early .props, since BuildIpa isn't available there. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
✅ API diff for current PR / commitNET (empty diffs)✅ API diff vs stableNET (empty diffs)ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
🚀 [CI Build #774a5db] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 199 tests passed 🎉 Tests counts✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download macOS tests✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download Linux Build VerificationPipeline on Agent |
Why
App Store Connect (and Xcode's Organizer) only symbolicate an app's crash reports automatically when the uploaded
.ipacontains a top-levelSymbolsdirectory with the*.symbolsfiles Apple expects. Our builds never produced those files, so uploaded apps showed up as "missing symbols" and crash reports stayed unsymbolicated. This is a long-standing pain point (issue #17807 from 2023).Xcode generates that
Symbolsdirectory by runningxcrun symbolsover the DWARF binaries inside each dSYM. This PR does the same during our IPA build.Approach
CreateSymbolsPackage(modeled on the existingDSymUtiltask). For each dSYM it runs:*.symbolsfiles Apple needs. The full dSYMs are not embedded in the.ipa._CreateIpaSymbolsfinds all*.dSYMdirectories the build produced, runs the task intoipa/Symbols, and adds that directory to_IpaPackageSourceso_ZipIpaincludes it. It's wired intoCreateIpaDependsOnbetween_PackageOnDemandResourcesand_ZipIpa.IpaIncludeSymbolsproperty controls the behavior. It defaults totruewhenever an IPA is being built ($(BuildIpa)), so apps get symbolicated crash reports out of the box. SetIpaIncludeSymbols=falseto opt out.The default is computed in
Xamarin.Shared.targets(whereBuildIpais resolved) rather than in the early.props, becauseBuildIpaisn't available that early.Notes for reviewers
SessionId+IsMacEnabled) so it works when building from Windows against a Mac.make world-stylecb) succeeds with 0 errors and confirmed the new task type is present in the builtXamarin.MacDev.Tasks.dll. The behavior would benefit from a CI/manual verification that a produced.ipaactually contains a populatedSymbolsdirectory.Fixes: #17807
🤖 Pull request created by Copilot