7月25號(hào)提交蘋(píng)果審核之后,26號(hào)收到郵件被拒并在iTunes connect中收到詳細(xì)被拒的原因和Crash日志附件馋记。
崩潰日志信息如下:
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018154c5e8 0x18152e000 + 124392
1 XHQB 0x0000000100707944 0x100084000 + 6830404
2 Foundation 0x0000000182f5cd94 0x182f3c000 + 134548
3 Foundation 0x0000000182f60f50 0x182f3c000 + 151376
4 XHQB 0x000000010025a5f4 0x100084000 + 1926644
5 Foundation 0x00000001830464cc 0x182f3c000 + 1090764
6 CoreFoundation 0x000000018250142c 0x182426000 + 898092
7 CoreFoundation 0x0000000182500d9c 0x182426000 + 896412
8 CoreFoundation 0x00000001824fe9a8 0x182426000 + 887208
9 CoreFoundation 0x000000018242eda4 0x182426000 + 36260
10 GraphicsServices 0x0000000183e98074 0x183e8c000 + 49268
11 UIKit 0x00000001886e2058 0x18866d000 + 479320
12 XHQB 0x000000010022cab4 0x100084000 + 1739444
13 libdyld.dylib 0x000000018143d59c 0x181439000 + 17820
Thread 1 name: Dispatch queue: org.webkit.ImageDecoder
Thread 1:
0 libsystem_kernel.dylib 0x000000018154ce1c 0x18152e000 + 126492
1 libsystem_pthread.dylib 0x0000000181614814 0x181612000 + 10260
2 JavaScriptCore 0x000000018642e8b4 0x186421000 + 55476
3 JavaScriptCore 0x0000000186dc1b18 0x186421000 + 10095384
4 WebCore 0x000000018726ab20 0x1870b6000 + 1788704
5 WebCore 0x00000001876c57d8 0x1870b6000 + 6354904
6 WebCore 0x00000001876c5734 0x1870b6000 + 6354740
7 libdispatch.dylib 0x000000018140a9e0 0x181409000 + 6624
8 libdispatch.dylib 0x000000018140a9a0 0x181409000 + 6560
9 libdispatch.dylib 0x0000000181418ad4 0x181409000 + 64212
10 libdispatch.dylib 0x000000018140e2cc 0x181409000 + 21196
11 libdispatch.dylib 0x000000018141aa50 0x181409000 + 72272
12 libdispatch.dylib 0x000000018141a7d0 0x181409000 + 71632
13 libsystem_pthread.dylib 0x0000000181613100 0x181612000 + 4352
14 libsystem_pthread.dylib 0x0000000181612cac 0x181612000 + 3244
Thread 2:
0 libsystem_pthread.dylib 0x0000000181612ca8 0x181612000 + 3240
Thread 3:
0 libsystem_kernel.dylib 0x000000018154d314 0x18152e000 + 127764
1 libsystem_c.dylib 0x000000018146c8b0 0x181460000 + 51376
2 libc++.1.dylib 0x0000000180f7d3c4 0x180f36000 + 291780
3 JavaScriptCore 0x0000000186dd9d08 0x186421000 + 10194184
4 JavaScriptCore 0x0000000186dd9adc 0x186421000 + 10193628
5 JavaScriptCore 0x0000000186ddaebc 0x186421000 + 10198716
6 JavaScriptCore 0x0000000186ddade8 0x186421000 + 10198504
7 JavaScriptCore 0x0000000186ddb098 0x186421000 + 10199192
8 libsystem_pthread.dylib 0x000000018161568c 0x181612000 + 13964
9 libsystem_pthread.dylib 0x000000018161559c 0x181612000 + 13724
10 libsystem_pthread.dylib 0x0000000181612cb4 0x181612000 + 3252
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x000000018154ce1c 0x18152e000 + 126492
1 libsystem_pthread.dylib 0x0000000181614814 0x181612000 + 10260
2 Foundation 0x0000000182f99a9c 0x182f3c000 + 383644
3 Foundation 0x0000000182f5ccc8 0x182f3c000 + 134344
4 Foundation 0x0000000182f60f50 0x182f3c000 + 151376
5 XHQB 0x000000010025aadc 0x100084000 + 1927900
6 libsystem_platform.dylib 0x000000018161130c 0x18160b000 + 25356
7 UIKit 0x00000001886737b8 0x18866d000 + 26552
8 UIKit 0x000000018897b04c 0x18866d000 + 3203148
9 UIKit 0x000000018867a0b4 0x18866d000 + 53428
10 QuartzCore 0x000000018586a274 0x185753000 + 1143412
11 QuartzCore 0x000000018585ede8 0x185753000 + 1097192
12 QuartzCore 0x000000018585eca8 0x185753000 + 1096872
13 QuartzCore 0x00000001857da34c 0x185753000 + 553804
14 QuartzCore 0x00000001858013ac 0x185753000 + 713644
15 QuartzCore 0x0000000185801e78 0x185753000 + 716408
16 CoreFoundation 0x00000001825009a8 0x182426000 + 895400
17 CoreFoundation 0x00000001824fe630 0x182426000 + 886320
18 CoreFoundation 0x000000018242edc4 0x182426000 + 36292
19 WebCore 0x00000001870f9608 0x1870b6000 + 275976
20 libsystem_pthread.dylib 0x000000018161568c 0x181612000 + 13964
21 libsystem_pthread.dylib 0x000000018161559c 0x181612000 + 13724
22 libsystem_pthread.dylib 0x0000000181612cb4 0x181612000 + 3252
Thread 5 name: com.apple.uikit.eventfetch-thread
Thread 5:
0 libsystem_kernel.dylib 0x000000018152f224 0x18152e000 + 4644
1 libsystem_kernel.dylib 0x000000018152f09c 0x18152e000 + 4252
2 CoreFoundation 0x0000000182500e90 0x182426000 + 896656
3 CoreFoundation 0x00000001824feae4 0x182426000 + 887524
4 CoreFoundation 0x000000018242eda4 0x182426000 + 36260
5 Foundation 0x0000000182f48d74 0x182f3c000 + 52596
6 Foundation 0x0000000182f69b44 0x182f3c000 + 187204
7 UIKit 0x000000018906c6a8 0x18866d000 + 10483368
8 Foundation 0x00000001830462d8 0x182f3c000 + 1090264
9 libsystem_pthread.dylib 0x000000018161568c 0x181612000 + 13964
10 libsystem_pthread.dylib 0x000000018161559c 0x181612000 + 13724
11 libsystem_pthread.dylib 0x0000000181612cb4 0x181612000 + 3252
此時(shí)并不能看出任何信息援奢,經(jīng)百度后得到要使用蘋(píng)果自帶的崩潰分析工具解析日志鸦难。具體步驟如下:
- 進(jìn)行崩潰分析,首先要弄懂一個(gè)概念顽铸,就是符號(hào)集。符號(hào)集是我們對(duì)ipa文件進(jìn)行打包之后料皇,和.app文件同級(jí)的后綴名為.dSYM的文件谓松,這個(gè)文件必須使用Xcode進(jìn)行打包才有。每一個(gè).dSYM文件都有一個(gè)UUID践剂,和.app文件中的UUID對(duì)應(yīng)鬼譬,代表著是一個(gè)應(yīng)用。而.dSYM文件中每一條崩潰信息也有一個(gè)單獨(dú)的UUID逊脯,用來(lái)和程序的UUID進(jìn)行校對(duì)优质。我們?nèi)绻皇褂?dSYM文件獲取到的崩潰信息都是不準(zhǔn)確的。符號(hào)集中存儲(chǔ)著文件名军洼、方法名巩螃、行號(hào)的信息,是和可執(zhí)行文件的16進(jìn)制函數(shù)地址對(duì)應(yīng)的匕争,通過(guò)分析崩潰的.Crash文件可以準(zhǔn)確知道具體的崩潰信息避乏。我們每次Archive一個(gè)包之后,都會(huì)隨之生成一個(gè)dSYM文件甘桑。每次發(fā)布一個(gè)版本拍皮,我們都需要備份這個(gè)文件歹叮,以方便以后的調(diào)試。進(jìn)行崩潰信息符號(hào)化的時(shí)候春缕,必須使用當(dāng)前應(yīng)用打包的電腦所生成的dSYM文件盗胀,其他電腦生成的文件可能會(huì)導(dǎo)致分析不準(zhǔn)確的問(wèn)題。當(dāng)程序崩潰的時(shí)候锄贼,我們可以獲得到崩潰的錯(cuò)誤堆棧票灰,但是這個(gè)錯(cuò)誤堆棧都是0x開(kāi)頭的16進(jìn)制地址,需要我們使用Xcode自帶的symbolicatecrash工具來(lái)將.Crash和.dSYM文件進(jìn)行符號(hào)化宅荤,就可以得到詳細(xì)崩潰的信息屑迂。
- 命令行解析蘋(píng)果附件中的Crash日志,步驟如下:
1.將symbolicatecrash,Xcode自帶的崩潰分析工具冯键,使用這個(gè)工具可以更精確的定位崩潰所在的位置惹盼,將0x開(kāi)頭的地址替換為響應(yīng)的代碼和具體行數(shù)。 我們打包時(shí)產(chǎn)生的dSYM文件惫确。崩潰時(shí)產(chǎn)生的Crash文件手报。這三個(gè)文件放到一個(gè)新建的Crash文件夾中。
- 蘋(píng)果給的日志是.txt后綴的文件改化,改成.Crash后綴的文件,命名可以和.dSYM命名相同掩蛤;
- .dSYM文件通過(guò)organizers獲取得到;
- Xcode自帶的崩潰分析工具陈肛,symbolicatecrash通過(guò)在終端輸入:find /Applications/Xcode.app -name symbolicatecrash -type f揍鸟,等一會(huì)后會(huì)出現(xiàn)symbolicatecrash的路徑。復(fù)制前往文件夾即能找到句旱。
2.cd到新建的Crash文件夾目錄阳藻,此時(shí)文件夾中有三個(gè)文件。
在終端輸入./symbolicatecrash ./.Crash ./.app.dSYM > symbol.crash此時(shí)會(huì)報(bào)錯(cuò)雖然在Crash文件家中也生成了symbol.crash文件谈撒,但是里面內(nèi)容是空的腥泥。
,必須再次輸入xcode-select -print-path啃匿,export DEVELOPER_DIR=/Applications/XCode.app/Contents/Developer,只有再次上次輸入上次的命令在Crash文件夾中得到symbol.crash文件道川。
3.打開(kāi)symbol.crash文件即可得到具體的崩潰信息。詳細(xì)如下:
Filtered syslog:
None found
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018154c5e8 __kill + 8
1 XHQB 0x0000000100707944 -[UmengUncaughtExceptionHandler handleException:] + 472
2 Foundation 0x0000000182f5cd94 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 968
3 Foundation 0x0000000182f60f50 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 144
4 XHQB 0x000000010025a5f4 -[XHUncaughtExceptionHandler handleException:] (XHCrashCatcher.m:65)
5 Foundation 0x00000001830464cc __NSThreadPerformPerform + 340
6 CoreFoundation 0x000000018250142c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
7 CoreFoundation 0x0000000182500d9c __CFRunLoopDoSources0 + 540
8 CoreFoundation 0x00000001824fe9a8 __CFRunLoopRun + 744
9 CoreFoundation 0x000000018242eda4 CFRunLoopRunSpecific + 424
10 GraphicsServices 0x0000000183e98074 GSEventRunModal + 100
11 UIKit 0x00000001886e2058 UIApplicationMain + 208
12 XHQB 0x000000010022cab4 main (main.m:21)
13 libdyld.dylib 0x000000018143d59c start + 4
Thread 1 name: Dispatch queue: org.webkit.ImageDecoder
Thread 1:
0 libsystem_kernel.dylib 0x000000018154ce1c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x0000000181614814 _pthread_cond_wait + 640
2 JavaScriptCore 0x000000018642e8b4 WTF::ThreadCondition::timedWait(WTF::Mutex&, double) + 80
3 JavaScriptCore 0x0000000186dc1b18 WTF::ParkingLot::parkConditionallyImpl(void const*, WTF::ScopedLambda<bool ()> const&, WTF::ScopedLambda<void ()> const&, WTF::TimeWithDynamicClockType const&) + 2256
4 WebCore 0x000000018726ab20 bool WTF::ConditionBase::waitUntil<WTF::Lock>(WTF::Lock&, WTF::TimeWithDynamicClockType const&) + 172
5 WebCore 0x00000001876c57d8 WTF::SynchronizedFixedQueue<WebCore::ImageFrameCache::ImageFrameRequest, 8ul>::dequeue(WebCore::ImageFrameCache::ImageFrameRequest&) + 136
6 WebCore 0x00000001876c5734 WTF::Function<void ()>::CallableWrapper<WebCore::ImageFrameCache::startAsyncDecodingQueue()::$_0>::call() + 224
7 libdispatch.dylib 0x000000018140a9e0 _dispatch_call_block_and_release + 24
8 libdispatch.dylib 0x000000018140a9a0 _dispatch_client_callout + 16
9 libdispatch.dylib 0x0000000181418ad4 _dispatch_queue_serial_drain + 928
10 libdispatch.dylib 0x000000018140e2cc _dispatch_queue_invoke + 884
11 libdispatch.dylib 0x000000018141aa50 _dispatch_root_queue_drain + 540
12 libdispatch.dylib 0x000000018141a7d0 _dispatch_worker_thread3 + 124
13 libsystem_pthread.dylib 0x0000000181613100 _pthread_wqthread + 1096
14 libsystem_pthread.dylib 0x0000000181612cac start_wqthread + 4
Thread 2:
0 libsystem_pthread.dylib 0x0000000181612ca8 start_wqthread + 0
Thread 3:
0 libsystem_kernel.dylib 0x000000018154d314 __semwait_signal + 8
1 libsystem_c.dylib 0x000000018146c8b0 nanosleep + 212
2 libc++.1.dylib 0x0000000180f7d3c4 std::__1::this_thread::sleep_for(std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000000l> > const&) + 80
3 JavaScriptCore 0x0000000186dd9d08 bmalloc::Heap::scavenge(std::__1::unique_lock<bmalloc::StaticMutex>&, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000l> >) + 272
4 JavaScriptCore 0x0000000186dd9adc bmalloc::Heap::concurrentScavenge() + 120
5 JavaScriptCore 0x0000000186ddaebc bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>::threadRunLoop() + 92
6 JavaScriptCore 0x0000000186ddade8 std::__1::__shared_ptr_emplace<std::__1::mutex, std::__1::allocator<std::__1::mutex> >::~__shared_ptr_emplace() + 0
7 JavaScriptCore 0x0000000186ddb098 void* std::__1::__thread_proxy<std::__1::tuple<void (*)(bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*), bmalloc::AsyncTask<bmalloc::Heap, void (bmalloc::Heap::*)()>*> >(void*) + 92
8 libsystem_pthread.dylib 0x000000018161568c _pthread_body + 240
9 libsystem_pthread.dylib 0x000000018161559c _pthread_body + 0
10 libsystem_pthread.dylib 0x0000000181612cb4 thread_start + 4
Thread 4 name: WebThread
Thread 4:
0 libsystem_kernel.dylib 0x000000018154ce1c __psynch_cvwait + 8
1 libsystem_pthread.dylib 0x0000000181614814 _pthread_cond_wait + 640
2 Foundation 0x0000000182f99a9c -[NSCondition wait] + 240
3 Foundation 0x0000000182f5ccc8 -[NSObject(NSThreadPerformAdditions) performSelector:onThread:withObject:waitUntilDone:modes:] + 764
4 Foundation 0x0000000182f60f50 -[NSObject(NSThreadPerformAdditions) performSelectorOnMainThread:withObject:waitUntilDone:] + 144
5 XHQB 0x000000010025aadc XHCrashCatcher_SignalHandler (XHCrashCatcher.m:130)
6 libsystem_platform.dylib 0x000000018161130c _sigtramp + 36
7 UIKit 0x00000001886737b8 -[UIView(Hierarchy) subviews] + 152
8 UIKit 0x000000018897b04c -[UIView(CALayerDelegate) _wantsReapplicationOfAutoLayoutWithLayoutDirtyOnEntry:] + 72
9 UIKit 0x000000018867a0b4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1256
10 QuartzCore 0x000000018586a274 -[CALayer layoutSublayers] + 148
11 QuartzCore 0x000000018585ede8 CA::Layer::layout_if_needed(CA::Transaction*) + 292
12 QuartzCore 0x000000018585eca8 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 32
13 QuartzCore 0x00000001857da34c CA::Context::commit_transaction(CA::Transaction*) + 252
14 QuartzCore 0x00000001858013ac CA::Transaction::commit() + 504
15 QuartzCore 0x0000000185801e78 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 120
16 CoreFoundation 0x00000001825009a8 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
17 CoreFoundation 0x00000001824fe630 __CFRunLoopDoObservers + 372
18 CoreFoundation 0x000000018242edc4 CFRunLoopRunSpecific + 456
19 WebCore 0x00000001870f9608 RunWebThread(void*) + 456
20 libsystem_pthread.dylib 0x000000018161568c _pthread_body + 240
21 libsystem_pthread.dylib 0x000000018161559c _pthread_body + 0
22 libsystem_pthread.dylib 0x0000000181612cb4 thread_start + 4
Thread 5 name: com.apple.uikit.eventfetch-thread
Thread 5:
0 libsystem_kernel.dylib 0x000000018152f224 mach_msg_trap + 8
1 libsystem_kernel.dylib 0x000000018152f09c mach_msg + 72
2 CoreFoundation 0x0000000182500e90 __CFRunLoopServiceMachPort + 192
3 CoreFoundation 0x00000001824feae4 __CFRunLoopRun + 1060
4 CoreFoundation 0x000000018242eda4 CFRunLoopRunSpecific + 424
5 Foundation 0x0000000182f48d74 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 304
6 Foundation 0x0000000182f69b44 -[NSRunLoop(NSRunLoop) runUntilDate:] + 96
7 UIKit 0x000000018906c6a8 -[UIEventFetcher threadMain] + 136
8 Foundation 0x00000001830462d8 __NSThread__start__ + 996
9 libsystem_pthread.dylib 0x000000018161568c _pthread_body + 240
10 libsystem_pthread.dylib 0x000000018161559c _pthread_body + 0
11 libsystem_pthread.dylib 0x0000000181612cb4 thread_start + 4
4.通過(guò)分析崩潰日志可以看到第一行是友盟統(tǒng)計(jì)的問(wèn)題:[UmengUncaughtExceptionHandler handleException:],隨后查代碼發(fā)現(xiàn)友盟統(tǒng)計(jì)的key沒(méi)有寫(xiě)正確立宜,更換key之后提交代碼冒萄,修改Build號(hào)為1.0.0.1打包到testFlight測(cè)試后,重新提交以供審核橙数。
5.之后故意在項(xiàng)目中制造數(shù)組越界的崩潰出現(xiàn),代碼和崩潰日志如下:
-(NSArray *)arr
{
NSLog(@"%@",_arr);
if (!_arr) {
_arr = [NSArray array];
NSLog(@"%@,%ld",_arr,_arr.count);
}
return _arr;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog(@"%@",self.arr[2]);
return YES;
}
Filtered syslog:
None found
Last Exception Backtrace:
0 CoreFoundation 0x18ce911b8 __exceptionPreprocess + 124
1 libobjc.A.dylib 0x18b8c855c objc_exception_throw + 56
2 CoreFoundation 0x18cdfbbac -[__NSArray0 objectAtIndex:] + 104
3 XHQB 0x1000c7460 -[AppDelegate application:didFinishLaunchingWithOptions:] (AppDelegate.m:107)
4 UIKit 0x192db86a4 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 400
5 UIKit 0x192fc8a98 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 3524
6 UIKit 0x192fce808 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1656
7 UIKit 0x192fe3104 __84-[UIApplication _handleApplicationActivationWithScene:transitionContext:completion:]_block_invoke.3139 + 48
8 UIKit 0x192fcb7ec -[UIApplication workspaceDidEndTransaction:] + 168
9 FrontBoardServices 0x18ea6792c __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 36
10 FrontBoardServices 0x18ea67798 -[FBSSerialQueue _performNext] + 176
11 FrontBoardServices 0x18ea67b40 -[FBSSerialQueue _performNextFromRunLoopSource] + 56
12 CoreFoundation 0x18ce3eb5c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
13 CoreFoundation 0x18ce3e4a4 __CFRunLoopDoSources0 + 524
14 CoreFoundation 0x18ce3c0a4 __CFRunLoopRun + 804
15 CoreFoundation 0x18cd6a2b8 CFRunLoopRunSpecific + 444
16 UIKit 0x192db17b0 -[UIApplication _run] + 608
17 UIKit 0x192dac534 UIApplicationMain + 208
18 XHQB 0x100230a64 main (main.m:21)
19 libdyld.dylib 0x18bd4d5b8 start + 4
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018be5f014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018bf27450 pthread_kill + 112
2 libsystem_c.dylib 0x000000018bdd3400 abort + 140
3 libc++abi.dylib 0x000000018b89d2d4 __cxa_bad_cast + 0
4 libc++abi.dylib 0x000000018b8bacc0 default_unexpected_handler() + 0
5 libobjc.A.dylib 0x000000018b8c8844 _objc_terminate() + 124
6 libc++abi.dylib 0x000000018b8b766c std::__terminate(void (*)()) + 16
7 libc++abi.dylib 0x000000018b8b7234 __cxa_rethrow + 144
8 libobjc.A.dylib 0x000000018b8c871c objc_exception_rethrow + 44
9 CoreFoundation 0x000000018cd6a32c CFRunLoopRunSpecific + 560
10 UIKit 0x0000000192db17b0 -[UIApplication _run] + 608
11 UIKit 0x0000000192dac534 UIApplicationMain + 208
12 XHQB 0x0000000100230a64 main (main.m:21)
13 libdyld.dylib 0x000000018bd4d5b8 start + 4