Xcode 中的 "strip Swift symbols" 实际上是做什么的?
What does "strip Swift symbols" in Xcode actually do?
导出包含 Swift 的项目存档时,我们可以选择 "strip Swift symbols"。尽管在只有一个虚拟 Swift 文件的项目中,我没有看到应用程序大小有任何差异,因此是最大剥离的完美案例。
这到底有什么作用,它如何影响最终的应用程序大小 (.ipa)?
P.S:如 Xcode 9 beta 6
所示
更新:实际上,在查看特定设备变体(虽然不是通用变体)时,我可以观察到 ipa 大小略有减少(3.4 MB 未压缩)
根据 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)
导出包含 Swift 的项目存档时,我们可以选择 "strip Swift symbols"。尽管在只有一个虚拟 Swift 文件的项目中,我没有看到应用程序大小有任何差异,因此是最大剥离的完美案例。
这到底有什么作用,它如何影响最终的应用程序大小 (.ipa)?
P.S:如 Xcode 9 beta 6
所示更新:实际上,在查看特定设备变体(虽然不是通用变体)时,我可以观察到 ipa 大小略有减少(3.4 MB 未压缩)
根据 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 usingdladdr()
, this setting can be disabled. To view the exported symbols from file that has been stripped, usexcrun dyldinfo -export
instead ofnm
. (31306055)