带有“Archive”的不同二进制文件和“为归档而构建”在Xcode4中
我正在尝试找出如何以正确的方式构建我的 Cocoa 应用程序的发行版本。
到目前为止,我已经使用了构建存档选项,并从 Xcode 的 DerivedData 文件夹深处获取了应用程序包。
今天,我尝试了存档菜单命令,并使用共享来保存我的应用程序包。它看起来更干净而且不那么老套。挖掘 DerivedData 文件夹感觉不是正确的做法。
但事情是这样的。这两个应用程序包内的二进制文件不相同。据我所知,他们的行为是一样的。但 diff
表明它们并不相等,而且它们的大小表明存在的差异不仅仅是微不足道的。例如,我使用“Build for Archiving”制作的发布二进制文件的大小为 29,576 字节。 “存档”版本只有 21,536 字节。
归档和存档听起来基本上应该是同一件事。为什么它们不同?哪一个“更好”?
I'm trying to figure out how to build a release version of my Cocoa app the right way.
So far I've used the Build for Archiving option, and grabbed the app bundle from deep inside Xcode's DerivedData folder.
Today I tried the Archive menu command, and used Share to save my app bundle. It seems cleaner and less hacky. Digging through the DerivedData folder just doesn't feel like the right thing to do.
But here's the thing. The binaries inside those two app bundles aren't the same. As far as I can see, they behave the same. But diff
shows that they aren't equal, and their sizes suggest that there are more than trivial differences. For example, my release binary made with "Build for Archiving" has a size of 29,576 bytes. The "Archive" version is only 21,536 bytes.
Archiving and Archive sound like they should basically be the same thing. Why are they different? Which one is "better"?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不同之处在于,归档命令执行构建归档所做的所有操作,并加上一些额外的操作来进行正确的归档。如果您执行构建存档和存档,然后查看日志导航器 (Cmd+7),您将看到存档的几行附加内容> 最后的行动。最值得注意的是,它对您的二进制文件执行Strip,这会从您的二进制文件中删除所有调试符号,从而使其更小。
The difference is that the Archive command does all that Build for Archiving does, plus some extra actions to make a proper archive. If you perform Build for Archiving and Archive, then view the Log Navigator (Cmd+7), you will see a few additional lines for the Archive action at the end. Most notably it performs Strip on your binary, which removes all the debug symbols from you binary, and thus making it smaller.