ios - Why unsigned xcarchive is larger than signed?
问题描述
I use the following command to generate signed xcarchive:
xcodebuild -workspace app.xcworkspace -scheme app -configuration 'Release' -sdk iphoneos archive -archivePath build/signed.xcarchive
to build unsigned xcarchive I just append at the end:
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
And I'm curious why unsigned xcarchive has 332 MB and signed 222 MB?
I found out that for example libswiftCore.dylib
in signed xcarchive has only 23.3 MB and in unsigned has 95.4 MB. Strange.
- Xcode 10.2.1
- Swift 4
- Deployment target: 10.0
- Using
CocoaPods
- Additional dependencies:
Alamofire
解决方案
在通过比较每个构建的输出进行进一步调查后,opendiff
我发现每个构建的签名xcodebuild
运行bitcode_strip
都会dylib
显着减小大小。
这就是为什么这两个版本之间存在大小差异的原因。
xcodebuild
在未签名的构建运行的情况下更具体:
内置 swiftStdLibTool --copy --verbose ...
并且没有参数--sign
它不会剥离位码。来自构建输出的消息:
忽略 --strip-bitcode 因为 --sign 没有通过
因此,这似乎是 的预期行为xcodebuild
。
推荐阅读
- javascript - 错误:表格中超出了最大更新深度
- excel - 从 VBA 打开 .btw 文件
- android - RecyclerView 只显示最后一项
- angular - 我们如何创建一个仅使用角度材料响应的侧导航栏?
- rxjs - eslint 错误:找不到任何可观察的实现或 global.Observable
- php - 仅使用服务器信息加载 ldap 树
- c# - 如何将通用配置文件与 Automapper 和 Asp.Net 核心依赖注入一起使用
- java - 在 JSP 页面更改上下文根之间导航
- python - Django python manage.py runserver 输出正在执行系统检查...然后退出而没有错误代码,使用 mysqlclient
- php - 如何下载远程图像文件?