iOS IPA文件大小-xcode-archive与xcodebuild命令 [英] iOS IPA file size - xcode-archive vs. xcodebuild command
问题描述
我遇到了一个问题,其中使用XCode-GUI存档操作生成的文件和使用命令行生成(xcodebuild命令)创建的文件之间,iOS应用程序文件(IPA)的大小不同. 大小很重要,因为我们从Apple得到以下消息:
I have encountered a problem where the size of iOS application file (IPA) is different between a file built using XCode-GUI archive action and the one created using a command-line build (xcodebuild command). The size matters because we're getting the following message from Apple:
提交的以下应用二进制文件为44.6 MB,但为App Store处理后为51.2 MB.这超出了蜂窝网络的下载大小限制,将需要通过Wi-Fi下载您的应用
使用Xcode构建的IPA文件比使用XCodeBuild命令构建的IPA文件小7MB.
The IPA file built with Xcode is 7MB smaller than the one built with XCodeBuild command.
我正在使用的命令行: /usr/bin/xcodebuild -sdk iphoneos-配置发行版ARCHS = armv7 VALID_ARCHS = armv7
The command line I'm using: /usr/bin/xcodebuild -sdk iphoneos -configuration Release ARCHS=armv7 VALID_ARCHS=armv7
推荐答案
通过在命令行中添加以下开关来解决问题:
Problem solve by adding the following switches to the command line:
DEPLOYMENT_POSTPROCESSING =是
DEPLOYMENT_POSTPROCESSING=YES
STRIP_INSTALLED_PRODUCT =是
STRIP_INSTALLED_PRODUCT=YES
SEPARATE_STRIP =是
SEPARATE_STRIP=YES
COPY_PHASE_STRIP =是
COPY_PHASE_STRIP=YES
我还在XCode项目文件和GUI中看到了这些设置,但是-由于某种原因-运行发布"配置时不需要这些设置.
I see those settings also in the XCode project file and in the GUI but - for some reason - running the 'Release' configuration do it without those settings.
这篇关于iOS IPA文件大小-xcode-archive与xcodebuild命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!