Various binary files with “Archive” and “Build for Archiving” in Xcode4

I am trying to figure out how to properly create a version of my Cocoa application.

So far, I have used the Create option for archiving and grabbed the application package from the Xcode DerivedData deep folder.

Today I tried the Archive menu command and used Share to save my application package. It seems to be cleaner and less hacked. Digging into the DerivedData folder just doesn't seem to work properly.

But here is the thing. The binaries inside these two application packages do not match. As far as I can see, they behave the same. But diff shows that they are not equal, and their sizes suggest that there is more than a trivial difference. For example, my binary version created using Build for Archiving is 29,576 bytes in size. The Archive version is only 21,536 bytes.

Archiving and archiving sound as if they should be basically the same. Why are they different? Which one is "better"?

+6
source share
1 answer

The difference is that the Archive team does everything that the Assembly does for archiving , as well as some additional steps to create a proper archive. If you run Build for Archiving and Archive , then browse the log navigator (Cmd + 7), you will see some additional lines for Archive > action at the end. First of all, it executes Strip in your binary, which removes all debug symbols from the binary and thereby reduces it.

+5
source

Source: https://habr.com/ru/post/896732/


All Articles