Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IPA File Structure - SupportSwift & Symbols

Tags:

xcode

ios

swift

ipa

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.

like image 525
Ahmad F Avatar asked Nov 20 '16 09:11

Ahmad F


2 Answers

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: enter image description here

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

like image 187
sage444 Avatar answered Oct 19 '22 21:10

sage444


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

like image 2
Inder Kumar Rathore Avatar answered Oct 19 '22 20:10

Inder Kumar Rathore