Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS IPA file size - xcode-archive vs. xcodebuild command

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:

The app binary listed below was 44.6 MB when you submitted it, but will be 51.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

The IPA file built with Xcode is 7MB smaller than the one built with XCodeBuild command.

The command line I'm using: /usr/bin/xcodebuild -sdk iphoneos -configuration Release ARCHS=armv7 VALID_ARCHS=armv7

like image 504
yorammi Avatar asked Jul 15 '13 08:07

yorammi


People also ask

What does Xcodebuild archive do?

It archives your Xcode project by running the xcodebuild archive command and exports the archive into an . ipa file with the xcodebuild -exportArchive command. This . ipa file can be shared and installed on test devices, or uploaded to App Store Connect.

Is ipa size same as app size?

APP size is around 5MB for Android but ipa takes almost the double size 11.4MB.

What is Xcodebuild command?

DESCRIPTION. xcodebuild builds one or more targets contained in an Xcode project, or builds a scheme contained in an Xcode workspace or Xcode project. Usage To build an Xcode project, run xcodebuild from the directory containing your project (i.e. the directory containing the projectname. xcodeproj package).


1 Answers

Problem solve by adding the following switches to the command line:

DEPLOYMENT_POSTPROCESSING=YES

STRIP_INSTALLED_PRODUCT=YES

SEPARATE_STRIP=YES

COPY_PHASE_STRIP=YES

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.

like image 178
yorammi Avatar answered Oct 07 '22 06:10

yorammi