Skip to content

[msbuild] Embed the app's symbols in the .ipa (IpaIncludeSymbols)#26043

Draft
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/issue-17807-is-it-possible-to-embed-dsym-folder-in-m-9cc1df
Draft

[msbuild] Embed the app's symbols in the .ipa (IpaIncludeSymbols)#26043
rolfbjarne wants to merge 2 commits into
mainfrom
dev/rolf/issue-17807-is-it-possible-to-embed-dsym-folder-in-m-9cc1df

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Why

App Store Connect (and Xcode's Organizer) only symbolicate an app's crash reports automatically when the uploaded .ipa contains a top-level Symbols directory with the *.symbols files 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 Symbols directory by running xcrun symbols over the DWARF binaries inside each dSYM. This PR does the same during our IPA build.

Approach

  • New MSBuild task CreateSymbolsPackage (modeled on the existing DSymUtil task). For each dSYM it runs:
    xcrun symbols -noTextInSOD -noDaemon -arch all -symbolsPackageDir <ipa>/Symbols <dSYM DWARF binary>
    
    This produces only the *.symbols files Apple needs. The full dSYMs are not embedded in the .ipa.
  • New target _CreateIpaSymbols finds all *.dSYM directories the build produced, runs the task into ipa/Symbols, and adds that directory to _IpaPackageSource so _ZipIpa includes it. It's wired into CreateIpaDependsOn between _PackageOnDemandResources and _ZipIpa.
  • New IpaIncludeSymbols property controls the behavior. It defaults to true whenever an IPA is being built ($(BuildIpa)), so apps get symbolicated crash reports out of the box. Set IpaIncludeSymbols=false to opt out.

The default is computed in Xamarin.Shared.targets (where BuildIpa is resolved) rather than in the early .props, because BuildIpa isn't available that early.

Notes for reviewers

  • The task is remote-build aware (SessionId + IsMacEnabled) so it works when building from Windows against a Mac.
  • I could not run a full end-to-end IPA integration test locally: it requires the pinned Xcode (26.6) plus device signing, neither of which is available in my environment. I verified a clean build (make world-style cb) succeeds with 0 errors and confirmed the new task type is present in the built Xamarin.MacDev.Tasks.dll. The behavior would benefit from a CI/manual verification that a produced .ipa actually contains a populated Symbols directory.

Fixes: #17807

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits July 10, 2026 16:49
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>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 774a5db376021dc129c546cce4f983e49286bf09 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🚀 [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
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 15 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 15 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 17 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 18 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 18 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

macOS tests

✅ Tests on macOS Monterey (12): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Ventura (13): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sonoma (14): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Sequoia (15): All 5 tests passed. Html Report (VSDrops) Download
✅ Tests on macOS Tahoe (26): All 5 tests passed. Html Report (VSDrops) Download

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 774a5db376021dc129c546cce4f983e49286bf09 [PR build]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is it possible to embed DSYM (folder) in my IPA through Devops build?

2 participants