IPA generated by swift is so big, about 5MB

前端 未结 2 1736
日久生厌
日久生厌 2020-12-03 18:24

I have just create a simple project using swift language, then i compile and archive it to generate .ipa file. IPA file is so big, it is about 5 MB.

is it right(no p

相关标签:
2条回答
  • 2020-12-03 18:39

    Yes, that's about right. The libraries containing the entire Swift language have to be embedded in the IPA. Those libraries are part of the app, not part of the system - because Swift has to work even with backwards compatibility, in part because it is constantly changing (independently of system updates), and in part in order to work on iOS 7 (where the system has never heard of Swift). And they are about 5MB in size.

    0 讨论(0)
  • 2020-12-03 18:46

    To expand on matt's answer, here's a quote from the Swift blog on compatibility:

    You can trust that your app will work well into the future. […] This is possible because Xcode embeds a small Swift runtime library within your app’s bundle. Because the library is embedded, your app uses a consistent version of Swift that runs on past, present, and future OS releases.

    So if your newest app version was built with Xcode 6.0, and a user of your app is running iOS 8.1, and breaking changes to Swift were introduced to your app in between, your app won't break due to the iOS update. If your app just used system libraries, it could.

    This allows the developers of Swift to iterate more quickly without needing to build backwards compatibility between every version.

    An additional warning:

    While your app’s runtime compatibility is ensured, the Swift language itself will continue to evolve, and the binary interface will also change. To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.

    0 讨论(0)
提交回复
热议问题