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

ios crash分析方法

2015-05-19 14:22 183 查看
During the test and debug phases of your product development, configure a scheme to run your application with various memory management diagnostics and logging options enabled. Schemes have a Run action with a Diagnostics pane that allows you to choose from
a selection of runtime diagnostic tools.

To run your app with diagnostics

From the Scheme toolbar menu, choose a scheme.

From the same menu, choose Edit Scheme to display the scheme dialog.

In the left column, select Run.

To specify runtime diagnostics, click the Diagnostics tab.

Click Close.

Click the Run button or choose Product > Run.



Select the tools that you want Xcode to use. You can view output from these tools in the debug area console and in the debug log in the log navigator.
Memory Management options:

Enable Scribble. Fill allocated memory with 
0xAA
 and deallocated memory with 
0x55
.

Enable Guard Edges. Add guard pages before and after large allocations.

Enable Guard Malloc. Use 
libgmalloc
 to catch common memory problems such as buffer overruns and use-after-free.

Enable Zombie Objects. Replace deallocated objects with a “zombie” object that traps any attempt to use it. When you send a message to a zombie object, the runtime logs an error and crashes. You can look at the backtrace
to see the chain of calls that triggered the zombie detector.

Logging options:

Distributed Objects. Enable logging for distributed objects (
NSConnection
NSInvocation
NSDistantObject
,
and 
NSConcretePortCoder
).

Malloc Stack. Record stack logs for memory allocations and deallocations.

Log DYLD API Usage. Log dynamic-linker API calls (for example, 
dlopen
).

Log Library Loads. Log dynamic-linker library loads.

Debugger options:

Stop on Debugger() and DebugStr(). Enable Core Services routines that enter the debugger with a message. These routines send a SIGINT signal to the current process.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: