[No QA] Strip debug symbols from production iOS binaries#83249
Open
roryabraham wants to merge 7 commits intomainfrom
Open
[No QA] Strip debug symbols from production iOS binaries#83249roryabraham wants to merge 7 commits intomainfrom
roryabraham wants to merge 7 commits intomainfrom
Conversation
Add a shared script and Xcode Run Script build phases to both the HybridApp (Mobile-Expensify) and standalone (NewExpensify) projects that strip debug symbols from the app binary and embedded frameworks. This runs after dSYM generation and Sentry upload, preserving crash symbolication while reducing production IPA size by ~22MB (~11%). The script skips Debug configurations so local development is unaffected. Co-authored-by: Cursor <cursoragent@cursor.com>
8813ec8 to
28c1f7d
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
…ols phase The dSYM inputPath created a cycle in Xcode's build graph. Instead, use alwaysOutOfDate=1 to run the phase every build, matching how the Sentry upload phases work. Made-with: Cursor
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
Switch to the Sentry-recommended -exec bash -c pattern for the find command to match the proven approach. Also add a diagnostic message when the Frameworks directory is not found. Made-with: Cursor
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
XCFrameworks (like Onfido) extracted from ZIPs may lack the execute permission bits that the previous -perm -111 check required. Instead, iterate over .framework directories and locate binaries by the standard naming convention (binary name matches framework name without extension). Made-with: Cursor
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Contributor
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
Contributor
Author
|
@Pujan92 I don't think we need C+ review here |
Stripping invalidates the embedded code signature. While Xcode's final code signing step handles this, explicitly re-signing each framework after stripping is more robust and doesn't rely on implicit behavior. Made-with: Cursor
Contributor
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
Adds an Xcode Run Script build phase to both the HybridApp (Mobile-Expensify) and standalone (NewExpensify) iOS projects that strips debug symbols from the main app binary and all embedded third-party frameworks.
According to Sentry release metrics, debug symbols are contributing ~22MB to production bundles unnecessarily. The top contributors are:
The script uses
strip -rSTxto remove local symbols, debug symbols, Swift symbols not needed at runtime, and non-global symbols. It skips Debug configurations (so local dev is unaffected) and skips Apple-signed frameworks (which must not be modified).Ordering is critical: the stripping phase runs after dSYM generation and Sentry upload, so crash symbolication is preserved. The dSYM is listed as an input file dependency to enforce this ordering in Xcode.
Note
The Mobile-Expensify submodule change requires a corresponding PR to Mobile-Expensify.
Fixed Issues
$ #82999
Tests
Tested with an AdHoc build in Sentry:
Offline tests
None.
QA Steps
None.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — build pipeline change only
Android: mWeb Chrome
N/A — build pipeline change only
iOS: Native
iOS: mWeb Safari
N/A — build pipeline change only
MacOS: Chrome / Safari
N/A — build pipeline change only