Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "strip Swift symbols" in Xcode actually do?

Tags:

When exporting an archive of a project containing Swift, we get the option to "strip Swift symbols". I haven't seen any difference in app size though in a project with just one dummy Swift file, thus a perfect case for maximum stripping.

What does this do exactly and how does it affect the final app size (.ipa)?

enter image description here

P.S: as seen in Xcode 9 beta 6

UPDATE: actually I can observe a slight ipa size reduction (3.4 MB uncompressed) when looking at specific devices variants (not for universal variant though)

like image 723
atineoSE Avatar asked Sep 06 '17 14:09

atineoSE


1 Answers

According to the Xcode docs:

The new Strip Swift Symbols (STRIP_SWIFT_SYMBOLS) build setting is enabled by default. It adjusts the level of symbol stripping so that when the linked product of the build is stripped, all Swift symbols are removed. This significantly reduces the size of Swift frameworks. If the lack of Swift symbols causes problems, such as when using dladdr(), this setting can be disabled. To view the exported symbols from file that has been stripped, use xcrun dyldinfo -export instead of nm. (31306055)

like image 149
Manuel Avatar answered Oct 24 '22 23:10

Manuel