在AppDelegate.m文件中实现函数

void UncaughtExceptionHandler(NSException *exception) {
/**
* 获取异常崩溃信息
*/
NSArray *callStack = [exception callStackSymbols];
NSString *reason = [exception reason];
NSString *name = [exception name];
NSString *content = [NSString stringWithFormat:@"异常错误报告\n exception_name: %@\n exception_reason: \n%@ \n exception_callStackSymbols: \n%@ \nversion: %@ \n userInfo: %@\n returnAddress: %@\n",name,reason,[callStack componentsJoinedByString:@"\n"]]; JKSQLiteManager *manager = [JKSQLiteManager sharedSQLManager];
[manager insertInto:@"err" columns:@"(err_text)" values:[NSString stringWithFormat:@"('%@')",content]];
}

然后在

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 方法中调用

NSSetUncaughtExceptionHandler(&UncaughtExceptionHandler);

就可以获取应用的Crash报告了。

异常错误报告

exception_name:  NSInvalidArgumentException

exception_reason:

*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil

exception_callStackSymbols:

0   CoreFoundation                      0x00bfd494 __exceptionPreprocess + 180

1   libobjc.A.dylib                     0x006b7e02 objc_exception_throw + 50

2   CoreFoundation                      0x00aa3f91 -[__NSArrayM insertObject:atIndex:] + 881

3   CoreFoundation                      0x00aa3bf1 -[__NSArrayM addObject:] + 65

4   JKExceptionHandler                  0x000c9be2 -[ViewController crashBtn:] + 130

5   libobjc.A.dylib                     0x006cc0b5 -[NSObject performSelector:withObject:withObject:] + 84

6   UIKit                               0x00f97e38 -[UIApplication sendAction:to:from:forEvent:] + 118

7   UIKit                               0x00f97db7 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64

8   UIKit                               0x0113bf3b -[UIControl sendAction:to:forEvent:] + 79

9   UIKit                               0x0113c2d4 -[UIControl _sendActionsForEvents:withEvent:] + 433

10  UIKit                               0x0113b2c1 -[UIControl touchesEnded:withEvent:] + 714

11  UIKit                               0x0101852e -[UIWindow _sendTouchesForEvent:] + 1095

12  UIKit                               0x010195cc -[UIWindow sendEvent:] + 1159

13  UIKit                               0x00fbabe8 -[UIApplication sendEvent:] + 266

14  UIKit                               0x0df1c369 -[UIApplicationAccessibility sendEvent:] + 72

15  UIKit                               0x00f8f769 _UIApplicationHandleEventQueue + 7795

16  CoreFoundation                      0x00b0fe5f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15

17  CoreFoundation                      0x00b05aeb __CFRunLoopDoSources0 + 523

18  CoreFoundation                      0x00b04f08 __CFRunLoopRun + 1032

19  CoreFoundation                      0x00b04846 CFRunLoopRunSpecific + 470

20  CoreFoundation                      0x00b0465b CFRunLoopRunInMode + 123

21  GraphicsServices                    0x0425a664 GSEventRunModal + 192

22  GraphicsServices                    0x0425a4a1 GSEventRun + 104

23  UIKit                               0x00f95eb9 UIApplicationMain + 160

24  JKExceptionHandler                  0x000cce7a main + 138

25  libdyld.dylib                       0x025c4a25 start + 1

26  ???                                 0x00000001 0x0 + 1

version:    v1.0.0

userInfo:  (null)

returnAddress: (0xbfd478 0x6b7e02 0xaa3f91 0xaa3bf1 0xc9be2 0x6cc0b5 0xf97e38 0xf97db7 0x113bf3b 0x113c2d4 0x113b2c1 0x101852e 0x10195cc 0xfbabe8 0xdf1c369 0xf8f769 0xb0fe5f 0xb05aeb 0xb04f08 0xb04846 0xb0465b 0x425a664 0x425a4a1 0xf95eb9 0xcce7a 0x25c4a25 0x1)

iOS崩溃报告获取一的更多相关文章

  1. iOS崩溃报告获取二

    // // JKExceptionHandler.h // JKExceptionHandler // // Created by Jack on 16/9/7. // Copyright © 201 ...

  2. 【译】理解与分析ios应用的崩溃报告

    源网址: http://developer.apple.com/library/ios/#technotes/tn2151/_index.html 当一个应用程序崩溃时,创建一份“崩溃报告”对于理解崩 ...

  3. 转 理解与分析ios应用的崩溃报告

    理解与分析ios应用的崩溃报告 源网址: http://developer.apple.com/library/ios/#technotes/tn2151/_index.html 当一个应用程序崩溃时 ...

  4. 常用获取Android崩溃日志和IOS崩溃日志的几种方法

    一:前言 在日常测试app时,经常会遇到崩溃问题,测试快速抓取到崩溃日志可以有效方便开发进行定位,快速解决问题所在测试做到测试分析,定位是非常重要的,这也是判断一个测试能力指标的一大维度. 二:And ...

  5. iOS错误报告中关于崩溃地址的分析

    http://blog.csdn.net/gaoyp/article/details/46912753 一.错误报告中的三种地址:stack addressload addresssymbol add ...

  6. iOS崩溃日志分析-b

    1名词解释 1.1. UUID 一个字符串,在iOS上每个可执行文件或库文件都包含至少一个UUID,目的是为了唯一识别这个文件. 1.2. dwarfdump 苹果提供的命令行工具,其中一些功能就是查 ...

  7. 如何看iOS崩溃日志

    重点:Triggered by Thread这句话后边的线程号,快速定位问题出现在那个线程,是否是你的锅:Triggered by Thread所指的线程表示导致异常.崩溃的线程 下边内容转自简书 简 ...

  8. IOS崩溃 异常处理(NSSetUncaughtExceptionHandler)

    iOS已发布应用中对异常信息捕获和处理 代码下载地址:http://download.csdn.net/detail/daiyelang/6740205 iOS开发中我们会遇到程序抛出异常退出的情况, ...

  9. (转)IOS崩溃 异常处理(NSSetUncaughtExceptionHandler)

    iOS已发布应用中对异常信息捕获和处理 代码下载地址:http://download.csdn.net/detail/daiyelang/6740205 iOS开发中我们会遇到程序抛出异常退出的情况, ...

随机推荐

  1. B. Berland Bingo

    Lately, a national version of a bingo game has become very popular in Berland. There are n players p ...

  2. HDU-2550 百步穿杨

    百步穿杨 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submi ...

  3. js 打印网页指定内容

    function doPrint() { setTimeout(function() { bdhtml=window.document.body.innerHTML; sprnstr="&l ...

  4. 哈希(1) hash的基本知识回顾

    好久没看数据结构了,现在也打不起精神来,翻了一下书,严蔚敏那本书.,以下是书的第9章,发现自己很多时候对知识的认识无法结构化和系统化,都是零散的,模糊的混乱的记忆,以后要有体系, 第9章 查找     ...

  5. BZOJP1003 [ZJOI2006]物流运输trans

    BZOJP1003 [ZJOI2006]物流运输trans 1003: [ZJOI2006]物流运输trans Time Limit: 10 Sec  Memory Limit: 162 MB Sub ...

  6. 微信、QQ这类IM App怎么做——谈谈Websocket

    前言 关于我和WebSocket的缘:我从大二在计算机网络课上听老师讲过之后,第一次使用就到了毕业之后的第一份工作.直到最近换了工作,到了一家是含有IM社交聊天功能的app的时候,我觉得我现在可以谈谈 ...

  7. hdoj 1698 Just a Hook【线段树区间修改】

    Just a Hook Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  8. HTML头部<head>学习

    元素是所有头部元素的容器. 元素包含了所有的头部标签元素.在 元素中你可以插入脚本(scripts), 样式文件(CSS),及各种meta信息. 以下标签都可以添加到 head 部分: 1.title ...

  9. Contact Form 7邮件发送失败的解决办法

    一.contact form 7无法发送邮件的原因 对mail()函数的不支持. Contact Form 7表单提交失败在使用过程中会出现,归根结底原因在于wordpress主机问题,由于国 内很多 ...

  10. poj 1226

    跟3294比较类似,但是不需要输出具体的串,比较简单,只要把串反转连接上去解法就一样了. #include <iostream> #include <cstdio> #incl ...