最近在开发iOS平台上的SDK,提供给合作方使用。为了监控SDK自身的崩溃率,我们在SDK中加入了抓取crash的功能。但收集上来的日志中有较多合作方App的crash,并且接入SDK的App数量很多,产生的崩溃日志量非常大。靠人力从海量的日志中筛选出我们SDK的crash日志非常困难。
于是就有了这个问题,如何自动区分SDK内部的crash和App的crash?
License: MIT License
最近在开发iOS平台上的SDK,提供给合作方使用。为了监控SDK自身的崩溃率,我们在SDK中加入了抓取crash的功能。但收集上来的日志中有较多合作方App的crash,并且接入SDK的App数量很多,产生的崩溃日志量非常大。靠人力从海量的日志中筛选出我们SDK的crash日志非常困难。
于是就有了这个问题,如何自动区分SDK内部的crash和App的crash?
RT,拿到exception的callStackSymbols,怎么定位是哪一行导致的崩溃呢?是遍历数组,查找最靠上的TestSDKApp吗?
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23c7127e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff513fbb20 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23d03ab1 _CFThrowFormattedException + 194
3 CoreFoundation 0x00007fff23d0e4f6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.5 + 38
4 CoreFoundation 0x00007fff23cced8f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 239
5 CoreFoundation 0x00007fff23c6d12b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
6 TestSDKApp 0x000000010310eb79 +[TestCrash ocException] + 105
7 TestSDKApp 0x000000010310e583 -[ViewController onClickSDK1:] + 83
8 UIKitCore 0x00007fff48093fff -[UIApplication sendAction:to:from:forEvent:] + 83
9 UIKitCore 0x00007fff47a6c00e -[UIControl sendAction:to:forEvent:] + 223
10 UIKitCore 0x00007fff47a6c358 -[UIControl _sendActionsForEvents:withEvent:] + 398
11 UIKitCore 0x00007fff47a6b2b7 -[UIControl touchesEnded:withEvent:] + 481
12 UIKitCore 0x00007fff480cebbf -[UIWindow _sendTouchesForEvent:] + 2604
13 UIKitCore 0x00007fff480d04c6 -[UIWindow sendEvent:] + 4596
14 UIKitCore 0x00007fff480ab53b -[UIApplication sendEvent:] + 356
15 UIKit 0x0000000105533bd4 -[UIApplicationAccessibility sendEvent:] + 85
16 UIKitCore 0x00007fff4812c71a __dispatchPreprocessedEventFromEventQueue + 6847
17 UIKitCore 0x00007fff4812f1e0 __handleEventQueueInternal + 5980
18 CoreFoundation 0x00007fff23bd4471 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
19 CoreFoundation 0x00007fff23bd439c __CFRunLoopDoSource0 + 76
20 CoreFoundation 0x00007fff23bd3bcc __CFRunLoopDoSources0 + 268
21 CoreFoundation 0x00007fff23bce87f __CFRunLoopRun + 1263
22 CoreFoundation 0x00007fff23bce066 CFRunLoopRunSpecific + 438
23 GraphicsServices 0x00007fff384c0bb0 GSEventRunModal + 65
24 UIKitCore 0x00007fff48092d4d UIApplicationMain + 1621
25 TestSDKApp 0x000000010310e800 main + 112
26 libdyld.dylib 0x00007fff5227ec25 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.