Application received signal SIGABRT
(null)
((0 CoreFoundation 0x0000000184c6e37c+ 148
1 libobjc.A.dylib 0x0000000183eb4528 objc_exception_throw + 56
2 CoreFoundation 0x0000000184c6e2ac+ 0
3 appName 0x1004d3d04 appName + 5061892
4 libsystem_platform.dylib 0x000000018488fb40 _sigtramp + 36
5 libsystem_kernel.dylib 0x0000000184779bdc+ 100
6 libsystem_kernel.dylib 0x0000000184779c08 system_set_sfi_window + 0
7 TCC 0x000000018771e980+ 0
8 TCC 0x000000018771e8a0+ 0
9 TCC 0x000000018772213c+ 316
10 libxpc.dylib 0x00000001848cdd34+ 60
11 libxpc.dylib 0x00000001848cdc70+ 88
12 libdispatch.dylib 0x00000001845eb134+ 16
13 libdispatch.dylib 0x0000000184602bfc+ 324
14 libdispatch.dylib 0x00000001845f1a8c+ 400
15 libdispatch.dylib 0x00000001845f7cf4+ 600
16 libdispatch.dylib 0x00000001845f7a38 + 120
17 libsystem_pthread.dylib 0x000000018489306c _pthread_wqthread + 1268
18 libsystem_pthread.dylib 0x0000000184892b6c start_wqthread + 4
)
dSYM UUID: E6812B80-0121-3DB8-8DF9-C60D4746090D
CPU Type: arm64
Slide Address: 0x0000000100000000
Binary Image:appName
Base Address: 0x00000001009d4000
从友盟上,通常发现这类问题,然后就感觉无从查起了 加上次数不多,可能慢慢就放弃查它了。这些crash log 什么都看不出来,都是一些内存地址、帧调用栈等,所以需要进一步的解析:
从上面的crash log,找到一句
appName 0x1004d3d04 appName + 5061892
注:我们要保持好的打包痕迹,用时间来标记buildId,这样查找到需要使用的线上包比较方便,当然也可以直接将上线的.xcarchive文件保存下来。
打开终端
cd /Users/username/Library/Developer/Xcode/Archives/2018-01-18/appName\ 2018-1-18\ 上午9.41.xcarchive/dSYMs
$ dwarfdump --uuid appName.app.dSYM
UUID: 88FA5265-94D3-3112-9BDB-EA5CB5216313 (armv7) appName.app.dSYM/Contents/Resources/DWARF/appName
UUID: E6812B80-0121-3DB8-8DF9-C60D4746090D (arm64) appName.app.dSYM/Contents/Resources/DWARF/appName
crash log中的dSYM UUID与本地的dYSM文件是相匹配的。好接下来就查一下0x1004d3d04这个地址是什么
$ dwarfdump --arch=arm64 --lookup 0x1004d3d04 /Users/username/Library/Developer/Xcode/Archives/2018-01-18/appName\ 2018-1-18\ 上午9.41.xcarchive/dSYMs/appName.app.dSYM/Contents/Resources/DWARF/appName
----------------------------------------------------------------------
File: /Users/username/Library/Developer/Xcode/Archives/2018-01-18/appName 2018-1-18 上午9.41.xcarchive/dSYMs/appName.app.dSYM/Contents/Resources/DWARF/appName (arm64)
----------------------------------------------------------------------
Looking up address: 0x00000001004d3d04 in .debug_info... found!
0x003dcea1: Compile Unit: length = 0x0001142f version = 0x0002 abbr_offset = 0x00000000 addr_size = 0x08 (next CU at 0x003ee2d4)
0x003dceac: TAG_compile_unit [283] *
AT_producer( "Apple LLVM version 9.0.0 (clang-900.0.38)" )
AT_language( DW_LANG_ObjC_plus_plus )
AT_name( "/Users/username/Documents/appName/Pods/pop/pop/POPAnimator.mm" )
AT_stmt_list( 0x001d426c )
AT_comp_dir( "/Users/username/Documents/appName/Pods" )
AT_APPLE_optimized( 0x01 )
AT_APPLE_major_runtime_vers( 0x02 )
AT_low_pc( 0x00000001004d3370 )
AT_ranges( 0x0000c160
[0x00000001004d3370 - 0x00000001004d56e8)
[0x00000001004d56f8 - 0x00000001004d61a0)
End )
0x003e8d85: TAG_subprogram [148] *
AT_low_pc( 0x00000001004d3c84 )
AT_high_pc( 0x00000001004d4118 )
AT_frame_base( reg29 )
AT_object_pointer( {0x003e8da5} )
AT_name( "-[POPAnimator _renderTime:item:]" )
AT_decl_file( "/Users/username/Documents/appName/Pods/pop/pop/POPAnimator.mm" )
AT_decl_line( 561 )
AT_APPLE_optimized( 0x01 )
0x003dceac: TAG_compile_unit [283] *
AT_producer( "Apple LLVM version 9.0.0 (clang-900.0.38)" )
AT_language( DW_LANG_ObjC_plus_plus )
AT_name( "/Users/username/Documents/appName/Pods/pop/pop/POPAnimator.mm" )
AT_stmt_list( 0x001d426c )
AT_comp_dir( "/Users/username/Documents/appName/Pods" )
AT_APPLE_optimized( 0x01 )
AT_APPLE_major_runtime_vers( 0x02 )
AT_low_pc( 0x00000001004d3370 )
AT_ranges( 0x0000c160
[0x00000001004d3370 - 0x00000001004d56e8)
[0x00000001004d56f8 - 0x00000001004d61a0)
End )
Line table dir : '/Users/username/Documents/appName/Pods/pop/pop'
Line table file: 'POPAnimator.mm' line 577, column 23 with start address 0x00000001004d3cfc
Looking up address: 0x00000001004d3d04 in .debug_frame... not found.
看一下结果:发现有AT_name、Line table dir :、Line table file:,找到了出错的地方,pod的第三方pop文件里面有闪退情况。