1、生成linkmap文件,查看可执行文件的大小。在Build Settings中Write Link Map File设置为Yes(release时候不要设置为Yes),build后,LinkMap文件ingage-LinkMap-normal-x86_64,地址:/Users/XXX/Library/Developer/Xcode/DerivedData/XXX-aquckyasacajztamzgvydtrnnqtc/Build/Intermediates.noindex/XXX.build/Debug-iphonesimulator/ingage.build。

LinkMap分析工具:https://github.com/huanxsd/LinkMap

2、无用图片资源的删除。

工具:LSUnusedResources(https://github.com/tinymind/LSUnusedResources

3、图片压缩

    工具使用ImageOptim(https://github.com/ImageOptim/ImageOptim)。当然小熊猫tinypng这个压缩也非常好用(https://tinypng.com/

4、删除无用文件

工具:CATClearProjectTool-master(https://github.com/CatchZeng/CATClearProjectTool

5、打包策略调整,编译器优化级别。Xcode中,Build Settings->Optimization Level,release版应该选择Fastest, Smalllest,这个选项会开启那些不增加代码大小的全部优化,并让可执行文件尽可能小。

iOS 瘦身策略

6、去除符号信息。Xcode中,Strip Debug Symbols During Copy 和 Symbols Hidden by Default 在release版本应该设为yes,可以去除不必要的调试符号。

iOS 瘦身策略

相关文章:

  • 2021-06-28
  • 2021-06-28
  • 2022-12-23
  • 2021-05-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-08
猜你喜欢
  • 2021-08-07
  • 2018-07-20
  • 2022-02-20
  • 2021-10-17
  • 2022-12-23
  • 2022-02-04
  • 2022-01-14
相关资源
相似解决方案