V2EX 首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
iOS 开发实用书单
iPhone App Development: The Missing Manual
Cocoa and Objective-C: Up and Running
Cocoa Programming for Mac OS X
深入浅出设计模式 Head First Design Patterns
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
V2EX  ›  iDev

安利一个小工具 用于分析 iOS 包大小

  •  
  •   guomiaoyou7784 · 147 天前 · 1083 次点击
    这是一个创建于 147 天前的主题,其中的信息可能已经有所发展或是发生改变。

    LinkMapAnalyzer

    基于项目工程编译链接产生的 Linkmap 文件,分析项目中各个模块的大小。

    使用时要确保项目的 Build Settings -> Write Link Map File 已置为YES。然后在Path to Link Map File表明的路径里找到自己工程生成的 LinkMap 文件

    如 LinkMap 文件内容大致为

    # Path: /Users/guomiaoyou/Library/Developer/Xcode/DerivedData/GAG-focyaelrlonzsogsgfnrfxjywimo/Build/Products/Debug-iphonesimulator/GAG.app/GAG
    # Arch: x86_64
    # Object files:
    [  0] linker synthesized
    [  1] /Users/guomiaoyou/Library/Developer/Xcode/DerivedData/GAG-focyaelrlonzsogsgfnrfxjywimo/Build/Intermediates/GAG.build/Debug-iphonesimulator/GAG.build/GAG.app.xcent
    [  2] /Users/guomiaoyou/Library/Developer/Xcode/DerivedData/GAG-focyaelrlonzsogsgfnrfxjywimo/Build/Intermediates/GAG.build/Debug-iphonesimulator/GAG.build/Objects-normal/x86_64/GMYListItem.o
    [  3] /Users/guomiaoyou/Library/Developer/Xcode/DerivedData/GAG-focyaelrlonzsogsgfnrfxjywimo/Build/Intermediates/GAG.build/Debug-iphonesimulator/GAG.
    ...
    <<dead>> 	0x00000007	[ 44] literal string: length
    <<dead>> 	0x00000006	[ 44] literal string: alloc
    <<dead>> 	0x00000008	[ 44] literal string: CGImage
    <<dead>> 	0x00000011	[ 44] literal string: imageOrientation
    <<dead>> 	0x00000023	[ 44] literal string: initWithCGImage:scale:orientation:
    <<dead>> 	0x00000018	[ 44] CIE
    
    

    LinkMapAnalyzer 分析结果各个模块大小为:

    # Path: /Users/guomiaoyou/Library/Developer/Xcode/DerivedData/GAG-focyaelrlonzsogsgfnrfxjywimo/Build/Products/Debug-iphonesimulator/GAG.app/GAG
    # Arch: x86_64
    [debug]: 0-unknownFile-unknownModule
    [debug]: read file line count = 11811
    libAFNetworking.a                                                       314.20KB
    libSDWebImage.a                                                         194.45KB
    libMasonry.a                                                             94.99KB
    GAG                                                                      55.24KB
    libSVPullToRefresh.a                                                     43.88KB
    libarclite_iphonesimulator.a                                              7.43KB
    unknownModule                                                             2.04KB
    libPods-GAG.a                                                             0.25KB
    
    
    
    [-] totalSize : 0.695766MB
    [-] Cast Time : 8
    
    
    4 回复  |  直到 2017-03-02 10:57:58 +08:00
        1
    lynulzy   147 天前
    很方便
        2
    guomiaoyou7784   147 天前
    @lynulzy 谢谢支持。
        3
    XuYanci   85 天前 via iPhone
    能够分析不止是静态 目标文件等大小就更棒了
        4
    guomiaoyou7784   85 天前
    @XuYanci 可以讲讲你的具体需求吗?或者在 github 上给我提 issue ,我会抽空解决的
    DigitalOcean
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   鸣谢   ·   1627 人在线   最高记录 2477   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.7.5 · 47ms · UTC 11:07 · PVG 19:07 · LAX 04:07 · JFK 07:07
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1