iphone崩溃日志分析工具symbolicatecrash

其他地址: http://www.cocoachina.com/bbs/read.php?tid=180736

Symbolicatecrash是Xcode自带的一个分析工具,可以通过机器上的崩溃日志和应用的.dSYM文件定位发生崩溃的位置,把crash日志中的地址替换成代码相应位置。

使用效果:

分析前:

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 CoreFoundation 0x3723b870 0x37180000 + 768112
1 CoreFoundation 0x37196648 0x37180000 + 91720
2 CoreFoundation 0x37181e90 0x37180000 + 7824
3 CoreFoundation 0x3718bb74 0x37180000 + 47988
4 CoreFoundation 0x3718ba8e 0x37180000 + 47758
5 UIKit 0x30f0f866 0x30f0a000 + 22630
6 UIKit 0x30f0f98a 0x30f0a000 + 22922
7 UIKit 0x30f0f98a 0x30f0a000 + 22922
8 UIKit 0x310cdf3e 0x30f0a000 + 1851198
9 UIKit 0x30f0ecb6 0x30f0a000 + 19638
10 UIKit 0x30fe7b80 0x30f0a000 + 908160
11 UIKit 0x30fe7ab2 0x30f0a000 + 907954
12 UIKit 0x30f5f452 0x30f0a000 + 349266
13 UIKit 0x30fbf936 0x30f0a000 + 743734

分析后:

0 CoreFoundation 0x3723b870 ___forwarding___ + 136
1 CoreFoundation 0x37196648 _CF_forwarding_prep_0 + 40
2 CoreFoundation 0x37181e90 CFRetain + 76
3 CoreFoundation 0x3718bb74 +[__NSArrayI __new::] + 48
4 CoreFoundation 0x3718ba8e -[__NSPlaceholderArray initWithObjects:count:] + 294
5 UIKit 0x30f0f866 -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 70
6 UIKit 0x30f0f98a -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 362
7 UIKit 0x30f0f98a -[UIView(Hierarchy) _makeSubtreePerformSelector:withObject:withObject:copySublayers:] + 362
8 UIKit 0x310cdf3e __UIViewWillBeRemovedFromSuperview + 298
9 UIKit 0x30f0ecb6 -[UIView(Hierarchy) removeFromSuperview] + 50
10 UIKit 0x30fe7b80 -[UITableViewCell removeFromSuperview] + 124
11 UIKit 0x30fe7ab2 -[UITableView(_UITableViewPrivate) _reuseTableViewCell:] + 398
12 UIKit 0x30f5f452 -[UITableView reloadData] + 530
13 UIKit 0x30fbf936 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 938

 

使用方法:

1. 找到Symbolicatecrash文件

Xcode 4.3的之后

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/

Xcode 4.3之前

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

(附:Mac系统显示隐藏文件

终端中输入以下命令

显示Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool true

隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false

输入完回车,重启Finder:左上角的苹果标志-->强制退出-->Finder-->重新启动

2. Symbolicatecrash文件独立于Xcode,可以拷出来使用,附件中为Xcode4.5中的Symbolicatecrash文件

3. 命终端中输入命令,命令格式:Symbolicatecrash .crash .dSYM > aa.log

即:Symbolicatecrash + 崩溃日志 + APP对应的.dSYM文件 + > + 输出到的文件

 

4. 如果提示"DEVELOPER_DIR" is not defined

 

Xcode4.3之后 在终端中输入: export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

 

Xcode4.3之前 在终端中输入: export DEVELOPER_DIR=/Applications/Xcode.app

 

建议:每次打出版本后备份相应的.dSYM文件,对应版本崩溃后可根据此文件分析崩溃日志

 

 - by yuzhang2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值