File size: APK vs. IPA

  • Bayar Garam
    Participant
    Post count: 5
    #77185 |

    Hello,
    When I produce APK for Android devices it is only about 2 MB, but the IPA version for Apple devices is about 108 MB. Why is there such a big difference? Am I missing something?

    Thanks

  • Chris Hubbard
    Participant
    Post count: 18
    #77259 |

    Hello,

    Short Answer:
    The app will not be that big on the user’s phone. Probably about 20MB.

    Long Answer:
    With the different app builders, the process of creating the final app includes taking a template app, including the assets and configuration specified in the app builder project and packaging it together into either an Android APK or iOS IPA.

    With Android, the APK package name has to be unique per app and the package name is based on the actual Java namespace in the source. So the app builder generates a stub Java source file with that namespace and has to compile and link the APK.

    With iOS, the IPA “package name” (prog id) is in metadata and the IPA is just a zip file. At a terminal, you can run “unzip <project_name-version>.ipa and it will extract the contents into the current directory:
    Payload/<project_name-version>.app
    SwiftSupport

    You can run du -h -d 3 to see where the space is being used. Here is a very simple app with 4 books (gospels of Kuna San Blas) with audio configured to download from FCBH:

    `
    64K ./Payload/Kuna_Gospels-1.0.app/_CodeSignature
    3.4M ./Payload/Kuna_Gospels-1.0.app/assets
    4.0K ./Payload/Kuna_Gospels-1.0.app/Base.lproj
    68M ./Payload/Kuna_Gospels-1.0.app/Frameworks
    12K ./Payload/Kuna_Gospels-1.0.app/Launch Screen.storyboardc
    4.0K ./Payload/Kuna_Gospels-1.0.app/Settings.bundle/en.lproj
    8.0K ./Payload/Kuna_Gospels-1.0.app/Settings.bundle
    236K ./Payload/Kuna_Gospels-1.0.app/TemplateApp.storyboardc
    170M ./Payload/Kuna_Gospels-1.0.app
    170M ./Payload
    68M ./SwiftSupport
    238M .
    `
    You can see that 136M of the 238M are taken by SwiftSupport and Frameworks. From what I understand, these include multiple copies of the frameworks for all the architectures and for bitcode.

    So the apps are so large due to using Swift for the UI portion of the iOS template app. When we started development on the iOS version of template app, we had a decision of developing the app’s UI in Swift of Objective-C. At the time, the overhead was only 8MB and it seemed like Swift was taking over. Looking back, hindsight is 20/20 and we should have chosen swift.

    The good news is that When iOS installs the app on the device, it only include the version of the frameworks needed for the device. Also, when iOS updates an app, it only sends the diffs between the version on the phone and the one in the store.

    When you publish an app to iTunes Connect, it will show you the “App Store File Sizes” for your app. As an example, Balangao Bible in iTunes shows that the app is 39.1 MB. In iTunes Connect, it shows the estimated app sizes as:
    Universal: 39.1MB
    iPhone 5S: 22.7MB (also most modern iPhones and iPads)
    iPhone 5C: 20.4MB (also many older iPhones and iPads)

    I am asking the person who published this app what the upload size was and I will report back when I get a response.

  • Chris Hubbard
    Participant
    Post count: 18
    #77261 |

    I heard back. The signed IPA was 108.5MB (similar to yours). The file size on a user’s phone will be about 23MB.

    Chris

You must be logged in to reply to this topic.