How to generate a dSym file for a Release build and still strip symbols?

I'm building a OSX app and this is giving me a very hard time.


I need to generate a separate dSym file for symbolicating crash reports and I want to strip function names and symbols so as to keep out prying eyes.


I'm using these command line flags when building my Release build. It generates the dSym just fine, but it doesn't strip the symbols from the binary so the crash report shows my function names...which I don't want.


GCC_GENERATE_DEBUGGING_SYMBOLS=YES,

GCC_DEBUGGING_SYMBOLS = full,

DEBUG_INFORMATION_FORMAT=dwarf-with-dsym,

DWARF_DSYM_FILE_NAME = "$(TARGET_NAME).dSYM",

DWARF_DSYM_FOLDER_PATH = "$(CONFIGURATION_BUILD_DIR)/dSyms",

DEPLOYMENT_POSTPROCESSING = YES,

COPY_PHASE_STRIP=YES,

STRIP_INSTALLED_PRODUCT = YES,

STRIP_STYLE = all,

SEPARATE_STRIP = YES


Please help...thanks.

It's not immediately obvious, but the two things are not exactly related. The separate dSYM removes the debug information, including detailed symbol defintions, but executables normally have visible symbol names, for dynamic linking purposes. The build setting for stripping are really just about removing debugging information, not the symbols themselves.


You can find more information about this here:


https://developer.apple.com/library/content/technotes/tn2004/tn2123.html


under the heading "Stripping Mach-O Symbols". Note that this document is pretty old, and you may need to search for more recent information. (Try looking at the man pages for the "ld" linker tool.)

How to generate a dSym file for a Release build and still strip symbols?
 
 
Q