ios crash分析方法

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
  1. From the Scheme toolbar menu, choose a scheme.

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

  3. In the left column, select Run.

  4. To specify runtime diagnostics, click the Diagnostics tab.

  5. Click Close.

  6. Click the Run button or choose Product > Run.

    ../Art/xcsc-help_running-diagnostics-1_2x.png

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 (NSConnectionNSInvocationNSDistantObject, 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.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值