如何在上传前检查 iOS 应用程序大小
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6411397/
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
How to check iOS app size before upload
提问by ViggoV
I would like to be able to check the size of my app before submitting to the app store. More specifically I need to know whether it will be below the magic 20 MB, to allow cellular downloads, since the app is created for a festival.
我希望能够在提交到应用程序商店之前检查我的应用程序的大小。更具体地说,我需要知道它是否会低于神奇的 20 MB,以允许蜂窝下载,因为该应用程序是为节日而创建的。
采纳答案by Mr. Berna
The install file downloaded from the App Store will vary based on the device and what thinning is done to your app. An ad hoc distribution .ipa file will give an estimate of how big the install file from the App Store will be. Archive your app in Xcode, then make an ad hoc distribution. If you turn off app thinning while making this file you'll see the biggest your install file could be. If you turn on app thinning and generate all the variations of .ipa files you'll see all the different install file sizes.
从 App Store 下载的安装文件会因设备和应用程序的精简而有所不同。临时分发 .ipa 文件将估计来自 App Store 的安装文件有多大。在 Xcode 中存档您的应用程序,然后进行临时分发。如果您在制作此文件时关闭应用程序细化,您将看到您的安装文件可能是最大的。如果您打开应用程序精简并生成 .ipa 文件的所有变体,您将看到所有不同的安装文件大小。
To see an even more accurate answer to this question, submit your app to TestFlight. In the TestFlight app on your devices you can see the size of the app by checking the app details. Check it on multiple devices, it will vary if the app thinning process considers your devices sufficiently different and uses different assets from your app archive.
要查看此问题的更准确答案,请将您的应用提交给 TestFlight。在您设备上的 TestFlight 应用程序中,您可以通过查看应用程序详细信息来查看应用程序的大小。在多个设备上检查它,如果应用瘦身过程认为您的设备完全不同并使用来自您的应用存档的不同资产,它会有所不同。
Below is my original answer:
以下是我的原答案:
In Xcode 4: Once your app is ready for distribution, archive the app. In the Organizer, select the Archives tab. Select your app in the left hand column. Select the latest archive in the right hand column. Hit the Share... button in the top section. Save the file as an .ipa. Check file size in the Finder.
在 Xcode 4 中:一旦您的应用程序准备好分发,请归档该应用程序。在管理器中,选择存档选项卡。在左侧栏中选择您的应用。在右侧栏中选择最新的存档。点击顶部的共享...按钮。将文件另存为 .ipa。在 Finder 中检查文件大小。
回答by Vamos
This question is quite old, but IMO still relevant. Here is a recent message I received from Apple when I uploaded an app for review:
这个问题已经很老了,但 IMO 仍然相关。这是我上传应用程序以供审核时从 Apple 最近收到的一条消息:
The app binary listed below was 79.7 MB when you submitted it, but will be 132.2 MB once processed for the App Store. This exceeds the cellular network download size limit and would require your app to be downloaded over Wi-Fi.
下面列出的应用程序二进制文件在您提交时为 79.7 MB,但在为 App Store 处理后将变为 132.2 MB。这超出了蜂窝网络下载大小限制,需要通过 Wi-Fi 下载您的应用。
There is no way to know this 'once processed for the App Store' size until you've submitted your app.
在您提交应用程序之前,无法知道这个“一旦为 App Store 处理过”的大小。
There is a feature within the Organizer/Archives view that allows you to estimate your final app size. I have found this estimate is inaccurate. Here is the button you're looking for if you want to see this estimate:
管理器/档案视图中有一项功能可让您估算最终的应用程序大小。我发现这个估计是不准确的。如果您想查看此估算值,请点击以下按钮:
So what I have learned is that the "processed for the App Store" part above will mean your .ipa file is not an accurate measure of the final app size users will download. The Organizer/Archives estimation is incorrect, it seems the estimation is higher than the actual size, for example an archive sent for review was estimated at ~109 MB, the final app size in the store was ~90 MB and the .ipa filesize was ~47 MB.
所以我了解到,上面的“为 App Store 处理”部分意味着您的 .ipa 文件不是用户将下载的最终应用程序大小的准确度量。Organizer/Archives 估计不正确,估计似乎比实际大小要高,例如发送的存档估计约为 109 MB,商店中的最终应用程序大小约为 90 MB,.ipa 文件大小为~47 MB。
Why is the final size larger than the .ipa?
为什么最终大小比 .ipa 大?
I'd also like to know the answer to this, from what I understand it's related to DRM things that Apple adds to the .ipa.
我也想知道这个问题的答案,据我所知,它与 Apple 添加到 .ipa 的 DRM 内容有关。
UPDATE (June 2015)
更新(2015 年 6 月)
The latest version of Xcode does not have the 'Estimated App Store Size' option within the 'Organizer' view.
最新版本的 Xcode 在“组织者”视图中没有“估计 App Store 大小”选项。
UPDATE (November 2017)
更新(2017 年 11 月)
Estimated size information is available on App Store Connect:
App Store Connect 上提供了估计尺寸信息:
My Apps > App > Activity > Select a build > App Store File Sizes
我的应用程序 > 应用程序 > 活动 > 选择一个版本 > App Store 文件大小
回答by learnvst
In the current version of XCode (4.5 as of writing) you just have to click Product > Archive. The Archives tab of the Organiser will open and the estimated size in the app store is just displayed in one of the information fields when the archive is selected.
在当前版本的 XCode(撰写本文时为 4.5)中,您只需单击“产品”>“存档”。组织者的归档选项卡将打开,并在选择归档时,App Store中的估计大小仅显示在选定存档时的一个信息字段中。
回答by Hamsternik
For now, using Xcode > 10 you could get a real size of your *.ipafiles going through Xcode archivation workflow. When you'll take an archive, open user's folder w/ archived projects. Location is
~/Library/Developer/Xcode/Archives. Here you will find your last archived project, with
.xcarchive` extension. Click on it, and Xcode opens a window with all your projects which have been archived ever before.
现在,使用 Xcode > 10 您可以获得 *.ipa files going through Xcode archivation workflow. When you'll take an archive, open user's folder w/ archived projects. Location is
~/Library/Developer/Xcode/Archives . Here you will find your last archived project, with
.xcarchive` 扩展的实际大小。单击它,Xcode 会打开一个窗口,其中包含您以前存档过的所有项目。
Then, select yours and click on the right menu the Distribute App
button. Select Ad hoc
, which needs to export your builded .ipa locally. And when you will build it, store in any folder. Your folder should be named like Stage 2019-06-27 10-14-30
. And inside this folder you'll find a file named like App Thinning Size Report
. This file contains all info about any .ipa file for different devices with differenet iOS versions and it's compressed/uncompressed size.
然后,选择您的并单击右侧菜单中的Distribute App
按钮。选择Ad hoc
,这需要将您构建的 .ipa 导出到本地。当你构建它时,存储在任何文件夹中。您的文件夹应命名为Stage 2019-06-27 10-14-30
. 在此文件夹中,您会找到一个名为App Thinning Size Report
. 此文件包含有关具有不同 iOS 版本的不同设备的任何 .ipa 文件的所有信息,并且它是压缩/未压缩大小。
回答by akashivskyy
You have to Build & Archiveyour application, and then you can check the size of you IPA
file.
您必须构建和存档您的应用程序,然后您可以检查IPA
文件的大小。
IPA archive (IPhone App) is the file which is downloaded by users from the App Store
IPA归档(IP磨练一个PP)是由用户从App Store下载的文件
回答by Tanguy G.
With Xcode 8, since the estimate size button disappeared, one way to get a very close estimation (in my case the AppStore version is exactly + 2mb) is :
使用 Xcode 8,由于估计大小按钮消失,获得非常接近估计的一种方法(在我的情况下,AppStore 版本正好是 + 2mb)是:
- Archive your application
- Export your application for "iOS App Store Deployment"
- Extract the generated IPA (fast way, rename it to zip and double click)
- Go to the .app (Payload/YOUR_APPLICATION)
- Compress it (zip it with default finder action)
- 归档您的应用程序
- 为“iOS App Store 部署”导出您的应用程序
- 提取生成的 IPA(快速方法,将其重命名为 zip 并双击)
- 转到 .app (Payload/YOUR_APPLICATION)
- 压缩它(默认取景动作压缩它)
Et voilà :-)
等等 :-)
回答by Bobby
You can do this through App Store Connect:
您可以通过 App Store Connect 执行此操作:
- Choose your app within App Store Connect
- Select "Activity"
- Select "All Build" on the left pane
- Choose the build and look for "Compressed File Size"
- 在 App Store Connect 中选择您的应用
- 选择“活动”
- 在左侧窗格中选择“所有构建”
- 选择“压缩文件大小”的构建和外观
回答by therealManUtdFan
If you have tested your app on your device during development for the final time before you are ready to upload to App Store, you can go to "Settings -> General -> iPhone Storage" and scroll down the list of apps and find yours. Each app has size listed. That should be a good estimate of your app size.
如果您在准备上传到 App Store 之前在开发过程中最后一次在您的设备上测试了您的应用程序,您可以转到“设置 -> 常规 -> iPhone 存储”并向下滚动应用程序列表并找到您的应用程序。每个应用程序都列出了大小。这应该是对您的应用程序大小的一个很好的估计。
回答by visakh7
Build the application, get the .app file in your products folder, Reveal in finder and select the app and right click, choose "Get Info" to see the size of the application.
构建应用程序,在您的产品文件夹中获取 .app 文件,在查找器中显示并选择应用程序并右键单击,选择“获取信息”以查看应用程序的大小。