Skip to content

Commit 72c650a

Browse files
chore: Upload iOS-Swift dSYMs patch script (#2703)
Add a script that applies a patch, so Xcode uploads iOS-Swift's dSYMs to Sentry when building.
1 parent 75de85d commit 72c650a

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed

develop-docs/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@ Once daily and for every PR via [Github action](../.github/workflows/benchmarkin
5151
- Sauce Labs allows relaxing the timeout for a suite of tests and for a `XCTestCase` subclass' collection of test case methods, but each test case in the suite must run in less than 15 minutes. 20 trials takes too long, so we split it up into multiple test cases, each running a subset of the trials.
5252
- This is done by dynamically generating test case methods in `SentrySDKPerformanceBenchmarkTests`, which is necessarily written in Objective-C since this is not possible to do in Swift tests. By doing this dynamically, we can easily fine tune how we split up the work to account for changes in the test duration or in constraints on how things run in Sauce Labs etc.
5353

54+
## Upload iOS-Swift's dSYMs with Xcode Run Script
55+
56+
The following script applies a patch so Xcode uploads the iOS-Swift's dSYMs to Sentry during Xcode's build phase.
57+
Ensure to not commit the patch file after running this script, which then contains your auth token.
58+
59+
```sh
60+
./scripts/upload-dsyms-with-xcode-build-phase.sh YOUR_AUTH_TOKEN
61+
```
62+
5463
## Auto UI Performance Class Overview
5564

5665
![Auto UI Performance Class Overview](./auto-ui-performance-tracking.svg)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
2+
index 9adac264..8ef3a3bb 100644
3+
--- a/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
4+
+++ b/Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
5+
@@ -561,6 +561,7 @@
6+
637AFDA4243B02760034958B /* Resources */,
7+
630853552440C60F00DDE4CE /* Embed Frameworks */,
8+
D840D535273A07F600CDF142 /* Embed App Clips */,
9+
+ 62F226AA29A35FAE0038080D /* ShellScript */,
10+
);
11+
buildRules = (
12+
);
13+
@@ -821,6 +822,27 @@
14+
};
15+
/* End PBXResourcesBuildPhase section */
16+
17+
+/* Begin PBXShellScriptBuildPhase section */
18+
+ 62F226AA29A35FAE0038080D /* ShellScript */ = {
19+
+ isa = PBXShellScriptBuildPhase;
20+
+ buildActionMask = 2147483647;
21+
+ files = (
22+
+ );
23+
+ inputFileListPaths = (
24+
+ );
25+
+ inputPaths = (
26+
+ "${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}",
27+
+ );
28+
+ outputFileListPaths = (
29+
+ );
30+
+ outputPaths = (
31+
+ );
32+
+ runOnlyForDeploymentPostprocessing = 0;
33+
+ shellPath = /bin/sh;
34+
+ shellScript = "if which sentry-cli >/dev/null; then\nexport SENTRY_ORG=sentry-sdks\nexport SENTRY_PROJECT=sentry-cocoa\nexport SENTRY_AUTH_TOKEN=YOUR_AUTH_TOKEN\nERROR=$(sentry-cli upload-dif \"$DWARF_DSYM_FOLDER_PATH\" 2>&1 >/dev/null)\nif [ ! $? -eq 0 ]; then\necho \"warning: sentry-cli - $ERROR\"\nfi\nelse\necho \"warning: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases\"\nfi\n";
35+
+ };
36+
+/* End PBXShellScriptBuildPhase section */
37+
+
38+
/* Begin PBXSourcesBuildPhase section */
39+
637AFDA2243B02760034958B /* Sources */ = {
40+
isa = PBXSourcesBuildPhase;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
set -uox pipefail
3+
4+
# Use this script to apply a patch so Xcode uploads the iOS-Swift's dSYMs to
5+
# Sentry during Xcode's build phase.
6+
# Ensure to not commit the patch file after running this script, which then contains
7+
# your auth token.
8+
9+
SENTRY_AUTH_TOKEN="${1}"
10+
11+
REPLACE="s/YOUR_AUTH_TOKEN/${SENTRY_AUTH_TOKEN}/g"
12+
sed -i '' $REPLACE ./scripts/upload-dsyms-with-xcode-build-phase.patch
13+
14+
git apply ./scripts/upload-dsyms-with-xcode-build-phase.patch

0 commit comments

Comments
 (0)