升级到xcode7之后ipa文件尺寸增大,strip无效问题
2015-12-23 16:06
330 查看
If you have recently updated to new Xcode, you must have noticed the significant change in binary size. I saw it first when I was updating the JXcore's
iOS binaries. (If you didn't hear before, JXcore runs node.js applications on Android and iOS.) Long story short, the new binary was almost 10 times bigger than the previous one.
Some of the problems you might be facing with;
- `strip` command is no longer reducing the binary size
- compiled binary is no longer Xcode 6.x compatible (especially the simulators)
- Whatever you did, the binary size is more than 2 times bigger than previous one
Following list of compiler tweaks helped me to solve the problems above. The final binary size was still 1.4x bigger though but this much is really reasonable
comparing to my first result.
ENABLE_BITCODE - '-fembed-bitcode'
Starting with the Xcode 7, '-fembed-bitcode' is default during compilation. If you want to keep your framework compatible with Xcode 6.x version, do not
use this setting when compiling simulator builds! It will be still working for Xcode 7 hence for the simulators yet it will be also compatible with Xcode 6 builds.
GCC_GENERATE_DEBUGGING_SYMBOLS - '-fno-standalone-debug'
Use (both) settings above for compilation step. These settings kick in before the LLVM bitcode is embedded. So, the binary won't be carrying the LLVM IR
for debugging. Now you know the reason why 'strip' didn't help.
P.S. both `-fembed-bitcode` and `-fno-standalone-debug` are compile time options
Optimizing the binary size while preserving the compatibility took my last three hours. Hope the information above saves yours.
P.S. you still need `strip` if you were already using it
iOS binaries. (If you didn't hear before, JXcore runs node.js applications on Android and iOS.) Long story short, the new binary was almost 10 times bigger than the previous one.
Some of the problems you might be facing with;
- `strip` command is no longer reducing the binary size
- compiled binary is no longer Xcode 6.x compatible (especially the simulators)
- Whatever you did, the binary size is more than 2 times bigger than previous one
Following list of compiler tweaks helped me to solve the problems above. The final binary size was still 1.4x bigger though but this much is really reasonable
comparing to my first result.
ENABLE_BITCODE - '-fembed-bitcode'
Starting with the Xcode 7, '-fembed-bitcode' is default during compilation. If you want to keep your framework compatible with Xcode 6.x version, do not
use this setting when compiling simulator builds! It will be still working for Xcode 7 hence for the simulators yet it will be also compatible with Xcode 6 builds.
GCC_GENERATE_DEBUGGING_SYMBOLS - '-fno-standalone-debug'
Use (both) settings above for compilation step. These settings kick in before the LLVM bitcode is embedded. So, the binary won't be carrying the LLVM IR
for debugging. Now you know the reason why 'strip' didn't help.
P.S. both `-fembed-bitcode` and `-fno-standalone-debug` are compile time options
Optimizing the binary size while preserving the compatibility took my last three hours. Hope the information above saves yours.
P.S. you still need `strip` if you were already using it
相关文章推荐
- 浅谈python中截取字符函数strip,lstrip,rstrip
- python strip()函数 介绍
- gcc优化
- Python strip lstrip rstrip使用方法
- Makefile中主要函数用法
- 适配iOS 9系统
- iOS9 适配相关问题整理
- 学习Python (六)
- 生成支持Bitcode 的Lib
- python 文件操作
- Python 常用函数(一)
- leetcode之Reverse Interger
- 浅析Bitcode:一种中间代码
- iOS的Bitcode是什么?怎么配置?
- python strip()函数 介绍
- Python - 去除字符串首尾填充
- [Python] 去空白字符 strip
- 升级Xcode7后所要更改的配置
- python strip()函数
- xcode7集成百度地图(framwork包) archive是bitcode问题