I'm working on an app with another developer and they just submitted a release to the app store that was built on their computer. In order to make a build on my machine (that belongs to the same git commit), I have to alter the path to one of the libraries we use in my XCode project. Will any changes I make to the XCode project file change the dSYM? If I was able to make a build without modifying the XCode project file, would the dSYM file be the same?
1 Answer
A dSYM file is a "debug symbols file". It is generated when the "Strip Debug Symbols" setting is enabled in the build settings of your project.
When this setting is enabled, symbol names of your objects are removed from the resulting compiled binary (one of the many countermeasures to try and prevent would be hackers/crackers from reverse engineering your code, amongst other optimisations for binary size, etc.).
dSYM files will likely change each time your app is compiled (probably every single time due to date stamping), and have nothing to do with the project settings.
They are useful for re-symbolicating your crash reports. With a stripped binary, you won't be able to read any crash reports without first re-symbolicating them. Without the dSYM the crash report will just show memory addresses of objects and methods. Xcode uses the dSYM to put the symbols back into the crash report and allow you to read it properly.
Ideally, your dSYM file shouldn't be tracked in your git repo. Like other binaries that change on building, it's not useful to keep them in source control. However, having that said, it is important that you keep the dSYM files for each distributed build (betas, press releases, app store distributions, etc.) somewhere safe so that you are able to symbolicate any crash reports you might get. Xcode does this automatically for you when you use the Archive option. The created archive contains your app and its dSYM and is stored within Xcode's derived data directory.
-
39One addition: dSYMs and executables have an embedded UUID which matches. So every time a build is done will cause both to get a new UUID. The consequence is that symbolication only works if the UUID of the binary that caused a crash matches the UUID of the dSYM that is used for symbolication.– KerniMar 17, 2014 at 17:05
-
3Great answer here from Jasarien. I will just add that using "Archive" these days stores all of this neatly inside a folder in your Xcode directory. You can right-click an archive in your Organizer of Xcode and "Show in Finder". But for completeness I will add that my folder exists in ~/Library/Developer/Archive– bladnmanDec 29, 2014 at 18:00
-
4I'm a bit confused... You say "Strip Debug Symbols" needs to be enabled (set to "YES") in order to be generated? And yet underneath, it says that if the setting is enabled, the names of objects are removed... So, if I want to see my symbol names in Instruments, should this setting be set to "YES" or "NO"?– jowieMar 14, 2016 at 10:58
-
3As a rule of thumb, for debug builds,
Strip Debug Symbols
should beNO
, so that the debugger is able to display all of the symbols. Release builds should have it set toYES
, which removes the symbols from the binary, creating the .dSYM file to put them in. So when profiling, you should decide which configuration you'll use, if you need to see the symbols, then use a debug config so they're available - if you need to profile performance, probably best to use a release config.– JasarienMar 14, 2016 at 12:24 -
1Another setting that seems be needed for full symbolication in, e.g., local debug builds appears to be: Build Settings › Build Options › Debug Information Format › DWARF with dSYM File. Just like for release builds.– B98Jun 21, 2016 at 12:44