IOS友盟統計Bug追蹤 app
項目開發之初安卓和IOS都是使用Bugly來統計bug的後期IOS上線過程當中被退回提示一個關於Bugly的upload的一個方法衝突,而後IOS就改用友盟的,不過比較頭疼的是捕獲的IOS問題並不像安卓同樣可以清晰,只顯示內存地址,前期沒有經驗致使IOS打包人員沒有保存xcarchive文件,也就沒法定位了。最新的版本上線了讓其發給我當前版本的xcarchive來定位分析bug,在網上搜索了一下,使用一個工具(dSYM文件分析工具)來分析。ide
一、準備內容工具
dSYM文件分析工具,當前發佈版本的xcarchive文件,當前發佈版本的友盟Bug記錄oop
二、操做說明spa
打開dSYM文件分析工具(圖1),將xcarchive文件拖到「請將dSYM文件拖拽到窗口中並選中任意一個版本進行分析」,而後點擊拖拽的文件,會出現圖2會自動填寫選中dSYM文件的UUID。.net
圖1code
圖2blog
打開友盟選擇一個bug記錄,以下:
ip
[objc] view plaincopyprint?內存
-[NSNull rangeOfCharacterFromSet:]: unrecognized selector sent to instance 0x197941e70
(null)
(
0 CoreFoundation 0x00000001854802f4 <redacted> + 160
1 libobjc.A.dylib 0x0000000196ca40e4 objc_exception_throw + 60
2 CoreFoundation 0x00000001854873a4 <redacted> + 0
3 CoreFoundation 0x0000000185484154 <redacted> + 928
4 CoreFoundation 0x0000000185386ccc _CF_forwarding_prep_0 + 92
5 UIKit 0x000000018a236c44 <redacted> + 104
6 UIKit 0x000000018a3a52c0 <redacted> + 76
7 UIKit 0x000000018a3a5380 <redacted> + 56
8 UIKit 0x000000018a3a5464 <redacted> + 36
9 QuartzCore 0x0000000189800884 <redacted> + 320
10 UIKit 0x0000000189ed1f94 <redacted> + 160
11 UIKit 0x0000000189f973d0 <redacted> + 348
12 UIKit 0x000000018a1b5be8 <redacted> + 3220
13 UIKit 0x0000000189fa1268 <redacted> + 172
14 UIKit 0x0000000189ebd760 <redacted> + 580
15 QuartzCore 0x0000000189805e1c <redacted> + 152
16 QuartzCore 0x0000000189800884 <redacted> + 320
17 QuartzCore 0x0000000189800728 <redacted> + 32
18 QuartzCore 0x00000001897ffebc <redacted> + 276
19 QuartzCore 0x00000001897ffc3c <redacted> + 528
20 QuartzCore 0x00000001897f9364 <redacted> + 80
21 CoreFoundation 0x00000001854382a4 <redacted> + 32
22 CoreFoundation 0x0000000185435230 <redacted> + 360
23 CoreFoundation 0x0000000185435610 <redacted> + 836
24 CoreFoundation 0x00000001853612d4 CFRunLoopRunSpecific + 396
25 GraphicsServices 0x000000018eb776fc GSEventRunModal + 168
26 UIKit 0x0000000189f26fac UIApplicationMain + 1488
27 ????????? 0x00000001000450c4 ????????? + 200900
28 libdyld.dylib 0x0000000197322a08 <redacted> + 4
)
dSYM UUID: 95B2009C-C988-****-****-8393E7003FA8
CPU Type: arm64
Slide Address: 0x0000000100000000
Binary Image: ???
Base Address: 0x0000000100014000
首先對應bug中的dSYM UUID跟dSYM文件分析工具中的UUID是否同樣。
在Bug記錄中通常帶有項目名稱的或者因爲亂碼致使???的那行代碼就是項目錯誤行拷貝內存地址
[objc] view plaincopyprint?
0x00000001000450c4
和
[objc] view plaincopyprint?
Slide Address: 0x0000000100000000
到dSYM文件分析工具中,點擊分析按鈕,在有可能錯誤的地方就會顯示當前內存地址對應的代碼行。
最後到項目中找到對應的行查找問題就能夠了。