Xcode 存档太大

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28032489/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:30:42  来源:igfitidea点击:

Xcode Archive Is Too Large

iosxcodeunity3d

提问by Oliver Jones

I have a Unity3D project that I've already released for iOS via Xcode. Previously the archive size was about 30-40Mb which I'm happy with.

我有一个 Unity3D 项目,我已经通过 Xcode 为 iOS 发布了该项目。以前存档大小约为 30-40Mb,我对此很满意。

I've now changed a few things within the Unity project, and rebuilt it for Xcode. Now when I archive it, the size is around 110Mb, which is huge compared to the previous file size. I only changed the logo, and splash screen design.

我现在已经更改了 Unity 项目中的一些内容,并为 Xcode 重建了它。现在当我存档时,大小约为 110Mb,与之前的文件大小相比,这是巨大的。我只更改了徽标和闪屏设计。

Also, when I rebuild the older version, the size isn't 30-40Mb anymore, it's 110Mb too!

另外,当我重建旧版本时,大小不再是 30-40Mb,也是 110Mb!

So I'm guessing this is something to do with the new Xcode for iOS8? Not 100% sure, hence why Im asking.

所以我猜这与适用于 iOS8 的新 Xcode 有关?不是 100% 确定,因此我为什么要问。

Thanks.

谢谢。

回答by Leo Nguyen

Try to turn off BitCode. Open XCode => Build Pharses => search Enable BitCode. Take it No.

尝试关闭 BitCode。打开 XCode => Build Pharses => 搜索 Enable BitCode。拿它没有。

回答by Javi Barrera

Have you read this? http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

你读过这个吗? http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html

Also it can be fault of stripping level, try to use micro mscorlib.

也可能是剥离级别的错误,请尝试使用 micro mscorlib。

In addition you can take a look at Decrease Your App's Code Size from Mac App Programming Guide. https://developer.apple.com/library/mac/documentation/General/Conceptual/MOSXAppProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40010543-CH9-SW2

此外,您可以从 Mac 应用程序编程指南中查看减少应用程序的代码大小。 https://developer.apple.com/library/mac/documentation/General/Conceptual/MOSXAppProgrammingGuide/Performance/Performance.html#//apple_ref/doc/uid/TP40010543-CH9-SW2

回答by Mobile Ben

I believe part of what is happening here is the additional overhead for the arm64 slice (unless you were already including the arm64 slice previously). I would not expect that much of an increase in size for the arm64, but it would still be roughly X2 on the app binary (minus the resources).

我相信这里发生的部分是 arm64 切片的额外开销(除非您之前已经包含 arm64 切片)。我不希望 arm64 的大小增加那么多,但在应用程序二进制文件上它仍然大约是 X2(减去资源)。

As of Feb 1, Apple requires arm64 support as well as the app being built with the iOS 8 SDK. The default Xcode build setting enables arm64.

截至 2 月 1 日,Apple 需要 arm64 支持以及使用 iOS 8 SDK 构建的应用程序。默认的 Xcode 构建设置启用 arm64。

What you can do is Show Package Contentson the xarchive and work your way to the app executable binary. You can then compare the size difference on the app executable binary from before and now. You can also run lipo -infoon it to see all the slices from before and now. Note I am assuming you have an older xarchive to compare with.

您可以做的是Show Package Contents在 xarchive 上并按照自己的方式运行应用程序可执行二进制文件。然后,您可以比较之前和现在的应用可执行二进制文件的大小差异。您还可以运行lipo -info它以查看以前和现在的所有切片。注意我假设你有一个较旧的 xarchive 来比较。

I would then probably diff the rest of the resources (use something like Araxis merge) to see the differences in the files. This will let you see what resource files changed or got added. If your diff is only the executable, then you have isolated were the size difference has come from.

然后我可能会比较其余的资源(使用类似 Araxis merge 的东西)来查看文件中的差异。这将让您看到更改或添加了哪些资源文件。如果您的差异只是可执行文件,那么您已经隔离了大小差异的来源。

回答by Scott Driscoll

The 'Estimated App Store Size' reflects the installedapp size, not the downloadsize.

“估计的 App Store 大小”反映了已安装的应用程序大小,而不是下载大小。

I'm basing this off the following test:

我基于以下测试:

(Unity app build) Estimated App Store Size: 140.8 MB, size listed in store: 33.4 MB. The splash images alone inside the package add up to 30 megs uncompressed (all my jpegs were converted to pngs) so there's no way the installed size is 33.4 MB. After install, if I go to settings -> general -> usage -> Manage Storage I see the app is 141 MB installed.

(Unity 应用程序构建)估计 App Store 大小:140.8 MB,商店中列出的大小:33.4 MB。单独在包内的初始图像加起来有 30 兆未压缩(我所有的 jpeg 都转换为 png),所以安装大小不可能是 33.4 MB。安装后,如果我转到设置 -> 常规 -> 使用 -> 管理存储,我会看到该应用程序已安装 141 MB。

I'm not sure how to estimate the download size, which is what matters if you have an app you want to be downloaded over cellular network and needs to be under 100 MB downloaded.

我不确定如何估计下载大小,如果您有一个要通过蜂窝网络下载的应用程序并且需要下载小于 100 MB,这很重要。

I added this as a comment to the question, but I wish I had read this as an answer, so here it is.

我添加了这个作为对问题的评论,但我希望我已经阅读了这个作为答案,所以就在这里。