IPA File Structure - SupportSwift & Symbols

痞子三分冷 提交于 2019-12-12 08:28:43

问题


When unzipping the ".ipa" file, the output is: Payload directory that contains the application. However, sometimes the output is: Payload, SwiftSupport and Symbols directories.

  • What are the conditions to generate both SwiftSupport and Symbols directories?

Also, I noticed that SwiftSupport contains .dylib files, which -I assume- they are already exist in the application (right click -> show package contents -> frameworks), so:

  • The application should work fine even if they are not exist, what are the purpose of generating them?

I couldn't find any useful reference to describe what I'm looking for.


回答1:


After playing with archiver I found answers for all your questions.

What are the conditions to generate both SwiftSupport and Symbols directories?

SwiftSupport folder is managed by option ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES from target's Build Settings

Symbols directory is managed by checkbox on export dialog:

Since Xcode 7 there is also support for exportOptionsPlist with symbol export option for command line build, more details here

Second part is more interesting:

The application should work fine even if they are not exist, what are the purpose of generating them?

Answer to this question I found in ... apple's documentation:

Always embed the Swift standard libraries in the target's products, even if the target does not contain any Swift code. For example, this should be enabled if the target is embedding other products which contain Swift, or if it is a test target which does not contain Swift but which is testing a product which does. This setting only applies to wrapped products, not to standalone binary products.

So application's .ipa can contains this folder with libraries even without using of swift directly




回答2:


As sage444's answer give your some explanation to your answer. There are few points that I have observed.

Symbols: You need this folder to symbolicate your crash logs.

SwiftSupport: Although you have two copies of dylib one in Payload and other in framework. But when you upload it to iTunesConnect then the size of your downloadable app is less than the size of your ipa file. The iTunesConnect manages your duplicate items (dylibs).

For more info you can check this answer



来源:https://stackoverflow.com/questions/40702415/ipa-file-structure-supportswift-symbols

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!