IPA size after moving to Swift 2/iOS9

I've just moved my project to Swift 2.0 and iOS9. I have to turn off bitcode because my libaries don't support it.


My binary size i submitted to Hockey went from 12mb to 60mb. My xarchive went from 72mb to 289mb. Looking through the files it seems like libswiftCore.dylib is the biggest culpret going from 6mb to 77mb.


My client really wants to keep their binary under 15mb and it's new size at 60mb is a non-starter. Anyone had this experience?

Replies

The size of libswiftCore.dylib in your IPA, and the size of your IPA in general, is somewhat meaningless these days. The new thinning features in the store will remove unnecessary content from your app when delivering to specific devices, and libswiftCore.dylib contains bitcode even if your app doesn't. This bitcode is removed before your app is downloaded to a customer device.

Chris I can see on the app store, for an installed app (so I'm not talking about the IPA, but the size of the app installed into the device as seen by iOS), that the size of the same app + new code written in Swift, that we have an increase of at least 30% of the app size. As we double check the IPA, with the version - before Swift - we can clearly see that the *installed* app size, has this increase in size.
Also, we can see that libraries seems to be imported twice (as it happens to Firefox for iOS and described here: http://stackoverflow.com/questions/30602808/how-to-prevent-swiftsupport-libraries-to-be-included-twice, so I'm not understanding what's going on with bitcode architecture actually.

What about enterprise apps that are internally distributed? They don't go through the store.

If libswiftCore.dylib contains bitcode then does this imply that bitcode decreases binary size on iOS 7 and 8 as well? I understand that asset slicing does not apply to iOS before 9, but I haven't found any resources stating platform requirements for bitcode.


I just moved over to swift and I won't be able to include it if the binary size has this ~18 MB jump in size, so I need to know if this will be eliminated on older platforms as well.


Thanks

About size increases:


We're having a similar issue in our project, it seems that the swift libraries are included twice in a production ipa created from Xcode v7.3.1, the resulting ipa file increased from 23mb to 55mb.

Even if most of the binary isn't downloaded to the devices I'd still love to understand why the libraries are included twice, and are actually different in size.


Googling resulted in this stackoverflow thread (which is probably related to the original post) but without an answer.


➜ prosper_daily_swift.ipa ls -alh SwiftSupport/iphoneos/

total 100304

drwxr-xr-x 13 guti wheel 442B Jul 4 09:50 .

drwxr-xr-x 3 guti wheel 102B Jul 4 09:50 ..

-rwxr-xr-x 1 guti wheel 256K Apr 27 03:02 libswiftContacts.dylib

-rwxr-xr-x 1 guti wheel 41M Apr 27 03:02 libswiftCore.dylib

-rwxr-xr-x 1 guti wheel 780K Apr 27 03:02 libswiftCoreGraphics.dylib

-rwxr-xr-x 1 guti wheel 250K Apr 27 03:02 libswiftCoreImage.dylib

-rwxr-xr-x 1 guti wheel 256K Apr 27 03:02 libswiftCoreLocation.dylib

-rwxr-xr-x 1 guti wheel 532K Apr 27 03:02 libswiftDarwin.dylib

-rwxr-xr-x 1 guti wheel 336K Apr 27 03:02 libswiftDispatch.dylib

-rwxr-xr-x 1 guti wheel 4.5M Apr 27 03:02 libswiftFoundation.dylib

-rwxr-xr-x 1 guti wheel 448K Apr 27 03:02 libswiftObjectiveC.dylib

-rwxr-xr-x 1 guti wheel 337K Apr 27 03:02 libswiftPassKit.dylib

-rwxr-xr-x 1 guti wheel 540K Apr 27 03:02 libswiftUIKit.dylib



➜ prosper_daily_swift.ipa ls -alh Payload/Prosper\ Daily.app/Frameworks/

total 33832

drwxr-xr-x 13 guti wheel 442B Jul 4 09:50 .

drwxr-xr-x 1132 guti wheel 38K Jul 4 09:50 ..

-rwxr-xr-x 1 guti wheel 241K Jul 4 09:50 libswiftContacts.dylib

-rwxr-xr-x 1 guti wheel 12M Jul 4 09:50 libswiftCore.dylib

-rwxr-xr-x 1 guti wheel 397K Jul 4 09:50 libswiftCoreGraphics.dylib

-rwxr-xr-x 1 guti wheel 203K Jul 4 09:50 libswiftCoreImage.dylib

-rwxr-xr-x 1 guti wheel 241K Jul 4 09:50 libswiftCoreLocation.dylib

-rwxr-xr-x 1 guti wheel 293K Jul 4 09:50 libswiftDarwin.dylib

-rwxr-xr-x 1 guti wheel 241K Jul 4 09:50 libswiftDispatch.dylib

-rwxr-xr-x 1 guti wheel 1.6M Jul 4 09:50 libswiftFoundation.dylib

-rwxr-xr-x 1 guti wheel 289K Jul 4 09:50 libswiftObjectiveC.dylib

-rwxr-xr-x 1 guti wheel 242K Jul 4 09:50 libswiftPassKit.dylib

-rwxr-xr-x 1 guti wheel 300K Jul 4 09:50 libswiftUIKit.dylib