xcode-upload-dsyms.sh in the
apsio-cli repository
uploads a build’s dSYMs from an Xcode Run Script phase, for the Release configuration by
default. It calls the apsio CLI, which must be installed on the machine that builds.
Set it up
-
Copy
xcode-upload-dsyms.shinto your repository, for example toscripts/, and make it executable (chmod +x scripts/xcode-upload-dsyms.sh). - In the app target’s Build Settings, set Debug Information Format to “DWARF with dSYM File” for Release.
-
In Build Phases, add a New Run Script Phase as the last phase, with this script:
-
Add this Input File to the phase, so Xcode runs it after the dSYM is written:
With User Script Sandboxing on, also add
${DWARF_DSYM_FOLDER_PATH}as an Input File. -
Give the build your upload token: run
apsio login --with-tokenonce on a developer machine, or setAPSIO_TOKENin the build environment on CI. Never commit the token.
Settings
Set these as environment variables, or as user-defined build settings, which Xcode passes to the script:When an upload fails
By default a failed upload is a build warning, never a failed build: you can ship, and the crashes from that build stay unsymbolicated untilapsio upload dsyms succeeds for it. The
warning says why, for example a missing token or a missing CLI. With APSIO_STRICT=1 the
same problems are build errors.
Debug builds
Debug builds use Debug Information Format “DWARF” by default, which writes no dSYM, so their crashes cannot be symbolicated. To symbolicate crashes from Debug builds, for example while you test, set Debug Information Format to “DWARF with dSYM File” for Debug too, and setAPSIO_UPLOAD_CONFIGURATIONS to Debug Release. This makes Debug builds slower.