如何分析iOS app crash 报告

最近在玩《永恒战士2》游戏,经常崩溃,然后救想知道为什么崩溃,我救研究了下crash 报告,然后用xcode 打开 看了 的很迷茫啊,

其实也不是很难,研究下,学习下原理就好了。

 Xcode没有自动的进行符号化,这时候就需要自己去把地址解析成符号。

但是前提是,必须有相同版本xxx.app对应的.dSYM文件。(dSYM文件在build->Products->Debug-iphoneos下,就是debug的symbols文件,也就是将内存地址,转换成程序里的函数或变量和所属于的 文件名)

这时候打开Terminal,进入到build/Debug-iphoneos
使用命令:

atos -arch arm7 -o XXX.app/XXX 0xabcdef

atos -o MyAPP 0Xxxxxxxx -arch armv7 -l XXXXX
-l 后面跟的是动态加载的初始地址

这样就会显示出你出现bug的确切的那一行,或者方法名字 。

(XXX是你的App名字,用需要解析的地址替换上面的0xabcdef

arm7是编译App时所用的Architecture,也可能是arm6,如果在simulator上的App,这个位置应该用i386)

$atos 的参考和用法:

atos -- convert numeric addresses to symbols of binary images or processes

SYNOPSIS
     atos [-o <binary-image-file>] [-p <pid> | <partial-executable-name>] [-arch architecture] [-l <load-address>] [-s <slide>] [-printHeader]
          [-f <address-input-file>] [<address> ...]
DESCRIPTION
     The atos command converts numeric addresses to their symbolic equivalents.  If full debug symbol information is available, for example in a

     .app.dSYM sitting beside a .app, then the output of atos will include file name and source line number information.


其他参考资料:

http://stackoverflow.com/questions/5175990/ambiguous-iphone-crash-report

https://developer.apple.com/library/ios/#technotes/tn2008/tn2151.html

http://stackoverflow.com/questions/3065149/iphone-crash-log-doesnt-contain-methods-or-line-numbers?rq=1

http://www.cocoachina.com/macdev/cocoa/2010/0427/1222.html   (推荐)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值