40

I have an app for the Mac that I am trying to archive. I have done this in the past with an earlier version of Xcode however when I archive with Xcode 4, I get the following warning:

warning: skipping copy phase strip, binary is code signed: .....

The warning pertains to a helper tool that must be copied during the build phase. How do I resolve this warning?

Any suggestions?

mfaani
  • 33,269
  • 19
  • 164
  • 293
David
  • 14,205
  • 20
  • 97
  • 144

1 Answers1

96

The solution would be to go to the build settings of your application target (not the help tool target) and set "Strip Debug Symbols During Copy" to "No". This is the key COPY_PHASE_STRIP.

COPY_PHASE_STRIP screenshot

Activating this setting causes binary files which are copied during the build (e.g., in a Copy Bundle Resources or Copy Files build phase) to be stripped of debugging symbols. It does not cause the linked product of a target to be stripped (use Strip Linked Product for that).

The main problem is that you can not strip debug symbols from a signed executable. This is why you must skip this step.

smokris
  • 11,740
  • 2
  • 39
  • 59
cocoafan
  • 4,884
  • 4
  • 37
  • 45
  • Thanks – that makes sense now, and fixed my issue. Previously just skipped signing dylib resources, but got a warning this time when submitting to the Mac App Store. This is obviously the better solution. – DouglasHeriot Oct 30 '11 at 13:11
  • 3
    You can also turn on Deployment Post Processing, Strip Installed Product and Separate Strip and it will strip the binaries and still code sign. Debugging also works but only the first time, if you rerun, it appears Xcode 4.3 "regenerates" the .dSYM file and destroys the debugging information. – Peter N Lewis Mar 01 '12 at 01:32
  • 3
    This is *NOT* correct gentleman. Release builds (App Store) should *NOT* contain debug symbols, which make your app run slower. – Jorge Leandro Perez Dec 28 '15 at 21:22
  • @JorgeLeandroPerez Things have been changed since 2011. Back then it was possible to submit builds with debug symbols in framework binaries. Of course, you should always build an optimised version without debug symbols. But hey, it worked and did his job very well. – cocoafan Dec 29 '15 at 22:08
  • 2
    @cocoafan yeah! i'm not saying it's *not* possible. I'm saying that... as a workaround, it's acceptable. But shipping an app with debug symbols... just to silence a warning, by all means, cannot be the right answer. – Jorge Leandro Perez Dec 31 '15 at 00:32
  • That certainly suppresses the warning. However I'm getting this warning on my the stripping of dependency. I want to strip the app's main executable **and** the dependencies. If I set `COPY_PHASE_STRIP` to `NO` won't that make it so that my dependencies won't get stripped? – mfaani Mar 14 '23 at 03:34