上传AppStore的ipa包有大小限制吗?

3,140 阅读2分钟

先说结论,有限制: ipa包体(准确的说是.app目录)不能超过4GB,其中二进制可执行文件大小不能超过500M。 否则,包传上去了,过一会也会发邮件通知你包无效。

我以前一直以为没有限制,直到我昨天提审被拒了。

Hello,

We noticed one or more issues with a recent delivery for the following app:

Please correct the following issues and upload a new binary to App Store Connect.

ITMS-90558: Thinned app size is too large - The “/Payload/XXX.app” app bundle in the universal variant is 5 GB, which exceeds the maximum allowable size. After app thinning, your iOS app bundle in any variant must be less than 4 GB. For details, visit: developer.apple.com/help/app-st….

我传包时没报错,成功传上去了。但是App Store Connect后台一直加载不出来,过了好一会收到了上述邮件。然后,苹果后台终于加载出来了,但是对应的包显示为“二进制包已失效”。

查了官方文档,得出了开头的结论,官方文档如下:

构建版本的文件大小要求
对于 iOS 和 Apple tvOS App,请确保 App 符合相应操作系统的文件大小要求。App 的完整未压缩大小不得超过 4 GB。Apple Watch App 不得超过 75 MB。此外,每个 Mach-O 可执行文件(例如 app_name.app/app_name)应符合下表列出的文件大小要求。

OS 版本可执行文件大小上限备注
iOS 9.0 或更高版本Apple tvOS 9.0 或更高版本500 MB针对二进制文件中所有“__TEXT”部分的总和。
iOS 7.X 至 iOS 8.X60 MB针对每个架构片段中的“__TEXT”部分1。
低于 iOS 7.080 MB针对二进制文件中所有“__TEXT”部分的总和。

难怪大型游戏一般都把包体大小卡在4GB附近!原来是有限制。不过楼主也在AppStore发现少量游戏包体大小也达到了4GB、4.1GB,原因就不得而知了。

ipa超过4GB大小解决方案:安装包控制在4GB以下,启动后热更下载资源,下载前先弹窗提醒用户。

注意:苹果是允许启动热更下载资源的,但是请注意别让苹果等太久(5分钟),否则苹果会以各种理由来拒绝你:

2024-05-30 18:49

Guideline 4.0 - Design

We noticed an issue in your app that contributes to a lower-quality user experience than App Store users expect:

  • Portions of your app, or resources needed to use your app, loaded, refreshed, ran or responded very slowly. For example, when we loaded content upon launch, it took over 5 minutes.

2024-06-05 11:59
Guideline 4.2.3 - Design - Minimum Functionality

Your app did not include sufficient content in the binary for the app to function at launch, and we were required to download or unpack additional resources before we could use it.

参考资料:
《构建版本的文件大小要求》
《App 审核指南》