带有“Archive”的不同二进制文件和“为归档而构建”在Xcode4中

发布于 2024-12-03 08:40:36 字数 470 浏览 1 评论 0原文

我正在尝试找出如何以正确的方式构建我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

想你只要分分秒秒 2024-12-10 08:40:36

不同之处在于,归档命令执行构建归档所做的所有操作,并加上一些额外的操作来进行正确的归档。如果您执行构建存档存档,然后查看日志导航器 (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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文