Xcode 4 archive warning to skip copy phase
Asked Answered
T

1

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?

Triturate answered 31/3, 2011 at 3:6 Comment(0)
R
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.

Radioactivity answered 27/10, 2011 at 12:36 Comment(6)
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.Alburnum
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.Phosphoric
This is NOT correct gentleman. Release builds (App Store) should NOT contain debug symbols, which make your app run slower.Inevitable
@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.Radioactivity
@Radioactivity 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.Inevitable
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?Bonbon

© 2022 - 2024 — McMap. All rights reserved.