Skip to content

Commit 443c418

Browse files
feat(preprod): Add size analysis section for code signature size (#15479)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Adds a section to our "Understanding Size Analysis" to describe how code signing affects app size, which can explain small differences between the App Store size and local app size. ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [x] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [x] Checked Vercel preview for correctness, including links - [x] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --------- Co-authored-by: Alex Krawiec <[email protected]>
1 parent c4145df commit 443c418

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/platforms/apple/guides/ios/size-analysis/index.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ description: Upload iOS builds to Sentry for size analysis.
3838

3939
<Include name="size-analysis/app-thinning" />
4040

41+
### Binary Code Signature
42+
43+
<Include name="size-analysis/binary-code-signature" />
44+
4145
### App Store Connect File Sizes
4246

4347
<Include name="size-analysis/app-store-connect-file-sizes" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Mach-O binaries contain code signature data within the `LC_CODE_SIGNATURE` load command which itself contains `SHA1` and/or `SHA256` hashes of every page block. This means the size of this data will scale linearly with the size of your binary.
2+
3+
By default Sentry calculates the size of this data as-is. You may notice differences when comparing against your app downloaded from the App Store. For example, Xcode 26 archives only codesign with `SHA256` hashes, but the App Store codesigns with both `SHA1` and `SHA256` hashes. In other words, App Store downloads of your app may be slightly larger than what's produced by Xcode. This App Store behavior is subject to change at any time.
4+
5+
If you'd like to compare the impact of this on your app, you can re-sign each binary before uploading to Sentry:
6+
7+
```bash
8+
# Inspect the current code signature
9+
codesign -dvvv '/path/to/your/binary'
10+
11+
# Re-sign with a new code signature
12+
codesign --force \
13+
--sign 'Apple Distribution: Your Team (team_id)' \
14+
--digest-algorithm sha1 \
15+
--digest-algorithm sha256 \
16+
'/path/to/your/binary'
17+
```
18+
19+
This will force both `SHA1` and `SHA256` hashes to be used.

0 commit comments

Comments
 (0)