首页 技术 正文
技术 2022年11月15日
0 收藏 851 点赞 5,013 浏览 1358 个字

 

在做的项目中,用到了友盟的组件,在没有禁用错误日志上传之前,收集了一些错误日志。

有一些朋友看到了错误日志,却不知道怎么定位到程序的的代码中,实际上,这一步是非常的简单。
友盟没有集成.dSYM文件,只能显示错误的地址,无法显示详细的信息。

准备步骤,
1,友盟错误日志

                *** -[__NSArrayM objectAtIndex:]: index 20 beyond bounds [0 .. 19]
(null)
(
"0 CoreFoundation 0x371308bf __exceptionPreprocess + 162",
"1 libobjc.A.dylib 0x317fe1e5 objc_exception_throw + 32",
"2 CoreFoundation 0x37079b6b -[__NSArrayM objectAtIndex:] + 270",
"3 aaaaa 0x0004af6f aaaaa + 302959",
"4 UIKit 0x3277d565 -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 944",
"5 UIKit 0x327f5ce7 -[UITableView _userSelectRowAtPendingSelectionIndexPath:] + 158",
"6 Foundation 0x31ba0943 __NSFireDelayedPerform + 414",
"7 CoreFoundation 0x37104a63 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14",
"8 CoreFoundation 0x371046c9 __CFRunLoopDoTimer + 364",
"9 CoreFoundation 0x3710329f __CFRunLoopRun + 1206",
"10 CoreFoundation 0x370864dd CFRunLoopRunSpecific + 300",
"11 CoreFoundation 0x370863a5 CFRunLoopRunInMode + 104",
"12 GraphicsServices 0x3123cfcd GSEventRunModal + 156",
"13 UIKit 0x326f8743 UIApplicationMain + 1090",
"14 aaaaa 0x00003687 aaaaa + 9863",
"15 aaaaa 0x00003144 aaaaa + 8516"
)

2.找到.dSYM文件,在编译程序时,会自动生成这个文件,

3.把应用 aaaaaa.app和 .dSYM文件放到一个目录中,

执行

atos -arch armv7 -o 'aaaaaa.app/aaaa' -l 0x0004af6f

这样就得到了程序错误的对应的源代码地址。
--------------------------------------

当然,如果你的程序很复杂,友盟的功能肯定不够使用。

友盟无法返回详细的信息,Binary Images, Thread 0 crashed with ARM Thread State.. 更主要的是,很许多的错误代码友盟无法收集,也无法收集更多的信息。

这时,你就需要更专业的日志处理方法。

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,090
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,567
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,415
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,187
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,823
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,906