Swift 4.0.3 ABI Size

I added a few swift files to my Easy Peasy Solitaire and exported to find out just how big the current Swift 4.0.3 ABI size is.

Xcode 9.2, Swift 4.0.3, iOS 11.2 with deploy targeted iOS 10.0

I added 3 new swift files;

  • Utilities.swift
  • DeckShuffler.swift
  • SolitaireTests.swift (wouldn’t be included in an export as its XCTest related)
Xcode screen showing one of the swift files

Checking the sizes, steps to get an IPA and unarchive it;

  1. Use Product Menu, and Archive
  2. Export the IPA, to a Developer (its the easiest option to get file output)
  3. uncheck the stripping swift symbols, I left bitcode enabled.
  4. After a short time, I saved it to a temp directory
  5. use terminal to get the directory
    cd ~/DocumentsLocal/Easy Pease Solitaire 2018-01-30 15-20-13
  6. make a copy to work with.
    cp Easy\ Pease\ Solitaire.ipa Easy\ Pease\ Solitaire.zip
  7. unzip it
    unzip Easy\ Pease\ Solitaire.zip
  8. change into the extracted directory tree
    cd Payload
  9. change into the app bundle directory tree
    cd Solitaire.app/
  10. ls -l the files
  11. ls -l Frameworks

Here are my notes on file listed sizes.

-rwxr-xr-x 1 wthomps staff 598K Jan 30 15:19 Solitaire*

ls -l Frameworks/
total 36448
<strong>-rwxr-xr-x 1 wthomps staff 9.9M Jan 30 15:19 libswiftCore.dylib*</strong>
-rwxr-xr-x 1 wthomps staff 199K Jan 30 15:19 libswiftCoreAudio.dylib*
-rwxr-xr-x 1 wthomps staff 140K Jan 30 15:19 libswiftCoreFoundation.dylib*
-rwxr-xr-x 1 wthomps staff 315K Jan 30 15:19 libswiftCoreGraphics.dylib*
-rwxr-xr-x 1 wthomps staff 140K Jan 30 15:19 libswiftCoreImage.dylib*
-rwxr-xr-x 1 wthomps staff 163K Jan 30 15:19 libswiftCoreMedia.dylib*
-rwxr-xr-x 1 wthomps staff 176K Jan 30 15:19 libswiftDarwin.dylib*
-rwxr-xr-x 1 wthomps staff 532K Jan 30 15:19 libswiftDispatch.dylib*
<strong>-rwxr-xr-x 1 wthomps staff 4.1M Jan 30 15:19 libswiftFoundation.dylib*</strong>
-rwxr-xr-x 1 wthomps staff 140K Jan 30 15:19 libswiftGLKit.dylib*
-rwxr-xr-x 1 wthomps staff 143K Jan 30 15:19 libswiftGameplayKit.dylib*
-rwxr-xr-x 1 wthomps staff 163K Jan 30 15:19 libswiftMetal.dylib*
-rwxr-xr-x 1 wthomps staff 197K Jan 30 15:19 libswiftModelIO.dylib*
-rwxr-xr-x 1 wthomps staff 166K Jan 30 15:19 libswiftObjectiveC.dylib*
-rwxr-xr-x 1 wthomps staff 141K Jan 30 15:19 libswiftQuartzCore.dylib*
-rwxr-xr-x 1 wthomps staff 166K Jan 30 15:19 libswiftSceneKit.dylib*
-rwxr-xr-x 1 wthomps staff 161K Jan 30 15:19 libswiftSpriteKit.dylib*
-rwxr-xr-x 1 wthomps staff 206K Jan 30 15:19 libswiftUIKit.dylib*
-rwxr-xr-x 1 wthomps staff 161K Jan 30 15:19 libswiftos.dylib*
-rwxr-xr-x 1 wthomps staff 622K Jan 30 15:19 libswiftsimd.dylib*
terminal screen shot showing Swift 4.0.3 ABI runtime file sizes

Over all storage use in megabytes;

du -sm Frameworks/
18 Frameworks/

18 Megabytes, all Swift library support.

I wasn’t aware that the Swift ABI library was still large.

The cost of the download to a customer over a Cellular connection would be a little bit much and take time, with most people on LTE networks and more and more people getting unlimited bandwidth on those LTE networks.

I won’t worry about Wifi and leisure apps, or where App or Game downloads are typically large already.

When the Swift ABI becomes stable, hopefully Apple will include the runtime and components with the OS updates and then we will see binary IPA sizes decrease significantly.

18 Megabytes is a small price to pay for ease of use, benefits of using Swift as a developer, and yes I’ve grown to really like it.

Facebook Comments