iphone崩溃日志分析工具symbolicatecrash用法

释放双眼,带上耳机,听听看~!

iphone崩溃日志分析工具symbolicatecrash

 

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   输入这个命令之后,会一直显示.DS_Store这个文件,且删不掉

隐藏Mac隐藏文件的命令:defaults write com.apple.finder AppleShowAllFiles -bool false  
输入这个命令之后,就不会显示.DS_Store这个文件了。

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

附录:

DS_Store 是给Finder用来存储这个文件夹的显示属性的:比如文件图标的摆放位置。删除以后的副作用就是这些信息的失去。(当然,这点副作用其实不是太大).

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

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

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

 

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

 

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

 

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

 

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

 

给TA打赏
共{{data.count}}人
人已打赏
安全经验

Google AdSense 全面发挥贵网站的创收潜力

2021-10-11 16:36:11

安全经验

安全咨询服务

2022-1-12 14:11:49

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索