为什么我的应用在 App Store 上大了 25%?

发布于 2024-10-21 01:33:18 字数 125 浏览 1 评论 0原文

我上传的 zip 文件大小为 19.5MB,但在 App Store 上,Apple 报告该文件大小为 24.5MB——对于无线下载来说太大了。 Apple 是否添加了 5MB 包装器?解压缩和重新压缩效率较低?使用815K“兆字节”?

The zip file I uploaded is 19.5MB, but on the App Store, Apple reports it as 24.5MB -- too large for over-the-air downloading. Is Apple adding a 5MB wrapper? Decompressing and recompressing less efficiently? Using 815K "megabytes"?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

深海蓝天 2024-10-28 01:33:18

来自苹果:

当您的申请获得批准后
Apple 将在 App Store 上销售,这是
出于 DRM 目的进行加密,并且
重新压缩。当加密是
添加,压缩文件的大小
会增加。的确切尺寸
增加会因应用程序而异,
然而,尺寸增加可以是
当二进制文件包含很多时很大
连续的零。我们无法
保证文件的大小
已添加加密。

源(展开部分查看构建的文件大小(iOS、tvOS)

From Apple:

When your application is approved by
Apple to sell on the App Store, it is
encrypted for DRM purposes and
re-compressed. When the encryption is
added, the size of the compressed file
will increase. The exact size of the
increase will vary from app to app,
however, the size increase can be
large when the binary contains a lot
of contiguous zeros. We are unable to
guarantee the size of your file after
the encryption has been added.

Source (Expand section View the file sizes of a build (iOS, tvOS))

我早已燃尽 2024-10-28 01:33:18

使用 iTunes 从 App Store 下载该应用程序。您最终应该在 ~/Music/iTunes/Mobile Applications 中得到一个 .ipa,这(希望)与您从 App Store 获得的差不多。检查其尺寸。您还可以使用 unzip -Z myapp.zip 之类的工具来检查单个文件的压缩大小(.ipa 只是 .zip)。

如果像 FreeAsInBeer 的答案一样,您的可执行文件的压缩大小正在增加负载,那么可能值得尝试解决此问题(5 MB 是很多代码)。使用 -Os 进行编译可能会有所帮助。

另请注意,.ipa 将包含一些附加信息,即 iTunesArtwork(来自最大 512x512 App Store 应用程序图标)和 iTunesMetadata.plist(其中包含 App Store 类别等内容)以及一些 FairPlay 信息。我不确定其中哪些会发送到设备。

最后,Apple 可能会使用 M = 106 而不是 220 — 19.5×220 ≈ 20.4×106< /sup> . IIRC 这是 Snow Leopard 的变化之一。

Download the app from the App Store with iTunes. You should end up with a .ipa in ~/Music/iTunes/Mobile Applications which is (hopefully) approximately what you get from the App Store. Check its size. You can additionally use something like unzip -Z myapp.zip to check the compressed size of individual files (an .ipa is just a .zip).

If, as in FreeAsInBeer's answer, your executable's compressed size is increasing loads, then it might be worthwhile trying to fix this (5 MB is a lot of code). Compiling with -Os might be helpful.

Also note that the .ipa will have some additional info, namely iTunesArtwork (from the up-to-512x512 App Store app icon) and iTunesMetadata.plist (which has stuff like the App Store category) and some FairPlay information. I'm not sure which of these are sent to the device.

And finally, Apple might be using M = 106 instead of 220 — 19.5×220 ≈ 20.4×106 . IIRC this was one of the changes in Snow Leopard.

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