在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. ARM学习笔记14——C语言和汇编相互套用

    这里,我们要准备两个文件,一个是汇编文件start.S,另一个是C文件led.c.汇编文件套用C文件中的开关灯函数,C文件套用汇编文件中延时函数. //start.S .global led_init ...

  2. [GRYZ2014]最大连续子序列的和

    求给定序列的最大连续子序列和. 输入:第一行:n(n<100000)             第二行:n个整数[-3000,3000]. 输出:最大连续子序列的和. 样例: 输入: 7 -6 4 ...

  3. 在Ubuntu 中安装eclipse, eclipse 文件已经下载好!

    If you've downloaded Eclipse from their official website, follow these steps for the installation. E ...

  4. 2013 ACM区域赛长沙 C Collision HDU 4793

    题意:在平面上0,0点,有一个半径为R的圆形区域,并且在0,0点固定着一个半径为RM(<R)的圆形障碍物,现在圆形区域外x,y,有一个半径 为r的,并且速度为vx,vy的硬币,如果硬币碰到了障碍 ...

  5. [SAM4N学习笔记]LED点灯程序

    一.准备工作:      将上一节搭建的工程模板复制一份,命名为"1.blink",这作为我们开发的第一个程序. 二.程序编写:      板子上只有一个可控制的LED,就是LED ...

  6. ubuntu14.04安装ia32-lib

    sudo apt-get install libc6:i386 sudo -i cd /etc/apt/sources.list.d echo "deb http://old-release ...

  7. SublimeText3使用技巧总结

    Ctrl + R : 查找函数和变量 Ctrl + P: 查找当前工程下面的文件 Ctrl + ":" : 查找变量 Ctrl + "g" : 输入行数跳转到指 ...

  8. 缓存算法–LRU

    LRU LRU是Least Recently Used 的缩写,翻译过来就是“最近最少使用”,也就是说,LRU缓存把最近最少使用的数据移除,让给最新读取的数据.而往往最常读取的,也是读取次数最多的,所 ...

  9. How I Mathematician Wonder What You Are! - POJ 3130(求多边形的核)

    题目大意:判断多多边形是否存在内核. 代码如下: #include<iostream> #include<string.h> #include<stdio.h> # ...

  10. javascript和php中的正则

    正则: var subStr=str.replace(reg/str,'');   不改变原来的字符串返回替换后的字符窜; 如果不用正则,只能替换第一个匹配到的; var subStr=str.mat ...