[No QA] Strip debug symbols from production iOS binaries#83249
[No QA] Strip debug symbols from production iOS binaries#83249roryabraham merged 8 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.
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
@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
|
@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". |
Julesssss
left a comment
There was a problem hiding this comment.
Local claude raised a few minor points, but I think we don' expect them to occur and can ignore
- We'd fallback to adhoc credentials if
EXPANDED_CODE_SIGN_IDENTITYwas missing - PR says
The dSYM is listed as an input file dependency to enforce this ordering in Xcodewhich doesn't happen,inputPathsis left empty
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
🚧 @roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.28-0 🚀
|
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.3.30-0 🚀
|
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.3.30-3 🚀
|
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