您的位置:首页 > 移动开发

如何利用crash report来定位出错的代码(Steps to analyze crash report from apple)

2011-12-14 13:32 459 查看
原文地址:http://www.eigo.co.uk/Deciphering-iPhone-Crash-Logs.aspx

The follow are lines of a crash log within this thread:

Thread 6

0 WebCore 0x3029a7c2 0x3023d000 + 382914

1 WebCore 0x3029ac96 0x3023d000 + 384150

... ...

17 MyApp 0x00004ee2 0x1000 + 16098

Atos (Address to Symbol) is a simple tool that translates memory addresses to symbols. All that you require to use this tool is a copy of the exact binary file sent to Apple for submission.

The basic use for this tool is as follows:

Syntax: # atos [–o executable] [address ...]

Example: # atos FixMobile 0x00004ee2

(where # symbol is the bash command line)

This will output to the console all the information that atos can determine about the memory address in the executable, for example:

- [MyViewController MyMethod:] (in ProjectName) (MyViewController.m:431)

when dealing with a "standard(armv6 armv7" (used to be called universal) app, note that you have to specify the arch on the commandline or you will get a message of the form cannot load symbols for the file . eg in directory where the .app and .dsym sit
atos -o myApp.ap/myApp -arch armv7 0x00b7eec

the same from http://stackoverflow.com/questions/1460892/symbolicating-iphone-app-crash-reports
Steps to analyze crash report from apple:

1.Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.

2.OPEN terminal application and go to the folder created above (using CD command)

atos -arch armv7 -o ''/'<.dSYM filename here>' . The memory location should be the one at which the app crashed as per the report.

Ex: atos -arch armv7 -o 'app name.app'/'app name' 0x0003b508

This would show you the exact line, method name which resulted in crash.

Ex: [classname functionName:]; -510
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: