之前提交app审核被拒绝,苹果返回的问题是说我的app在启动的时候崩溃了,但是在真机测试上却没有出现
下载了它返回的崩溃信息是几个后缀txt的文件,打开后看到类似信息
CrashReporter Key: 8f91de1a17ebfca9b6c3b0ae466fdb28d36a0eec
Hardware Model: xxx
Process: CloudCity [1205]
Path: /private/var/containers/Bundle/Application/0CD60427-F4DF-4602-8CAD-AA74AAA16966/CloudCity.app/CloudCity
Identifier: com.scities.user
Version: 6440 (6.4.3)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd [1]
Coalition: com.scities.user [933]
Date/Time: 2017-05-11 14:06:14.4707 -0700
Launch Time: 2017-05-11 14:06:14.2657 -0700
OS Version: iPhone OS 10.3.1 (14E304)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 1
Application Specific Information:
abort() called
Filtered syslog:
None found
Last Exception Backtrace:
(0x1849fafd8 0x18345c538 0x1849faf20 0x1853e64c4 0x10018f50c 0x1000cc35c 0x1838b29e0 0x1838b29a0 0x1838c0ad4 0x1838b62cc 0x1838c0fa8 0x1838c2a50 0x1838c27d0 0x183abb1d0 0x183abad7c)
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 dyld 0x0000000101286a00 0x101260000 + 158208
1 dyld 0x00000001012808c4 0x101260000 + 133316
2 dyld 0x0000000101264f44 0x101260000 + 20292
3 dyld 0x000000010126b104 0x101260000 + 45316
4 libdyld.dylib 0x00000001838e2b50 0x1838e1000 + 6992
5 libsqlite3.dylib 0x0000000184f774dc 0x184ef0000 + 554204
6 libdispatch.dylib 0x00000001838b29a0 0x1838b1000 + 6560
7 libdispatch.dylib 0x00000001838b36cc 0x1838b1000 + 9932
8 libsqlite3.dylib 0x0000000184ef2b84 0x184ef0000 + 11140
9 libsqlite3.dylib 0x0000000184ef118c 0x184ef0000 + 4492
10 CFNetwork 0x00000001850cae78 0x185001000 + 827000
11 CFNetwork 0x00000001850cada4 0x185001000 + 826788
12 CFNetwork 0x00000001850a0bdc 0x185001000 + 654300
13 CFNetwork 0x00000001850a09d0 0x185001000 + 653776
14 CFNetwork 0x00000001851db230 0x185001000 + 1942064
15 CloudCity 0x00000001000c68ac 0x100034000 + 600236
16 UIKit 0x000000018ab942dc 0x18ab13000 + 529116
17 UIKit 0x000000018ada0800 0x18ab13000 + 2676736
18 UIKit 0x000000018ada62a8 0x18ab13000 + 2699944
19 UIKit 0x000000018adbade0 0x18ab13000 + 2784736
20 UIKit 0x000000018ada353c 0x18ab13000 + 2688316
21 FrontBoardServices 0x00000001865a3884 0x186569000 + 239748
22 FrontBoardServices 0x00000001865a36f0 0x186569000 + 239344
23 FrontBoardServices 0x00000001865a3aa0 0x186569000 + 240288
24 CoreFoundation 0x00000001849a9424 0x1848ce000 + 898084
25 CoreFoundation 0x00000001849a8d94 0x1848ce000 + 896404
26 CoreFoundation 0x00000001849a69a0 0x1848ce000 + 887200
27 CoreFoundation 0x00000001848d6d94 0x1848ce000 + 36244
28 UIKit 0x000000018ab8d45c 0x18ab13000 + 500828
29 UIKit 0x000000018ab88130 0x18ab13000 + 479536
30 CloudCity 0x00000001001f058c 0x100034000 + 1820044
31 libdyld.dylib 0x00000001838e559c 0x1838e1000 + 17820
这个crash信息都是一些堆栈信息,要从这上面定位到crash很难,这里可以通过mac把.txt的崩溃文件转化为crash文件,从而可以直接定位到程序崩溃的地方
1.在桌面创建一个crashTemp文件夹
2.首先找到symbolicatecrash工具存放的地址(Xcode显示包内容亦可找到) 打开终端输入指令:
find /Applications/Xcode.app -name symbolicatecrash -type f
稍等片刻得到地址:/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash
3.用命令将symbolicatecrash拷贝到桌面的crashTemp文件夹里
cp /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/A/Resources /symbolicatecrash /Users/XXX/Desktop/crashTemp
4.Xcode>Window>Organize在Archives找到上传的App-右击-Show in Finder 右击后显示包内容 复制ProjectName.app和ProjectName.app.dSYM到crash文件夹里
5.校验ProjectName.app、ProjectName.app.dSYM、crashLog.txt 的UUID是否一致
dwarfdump --uuid ProjectName.app/ProjectName
dwarfdump --uuid ProjectName.app.dSYM
崩溃日志的UUID 在 Binary Images: 下第一行 ProjectName arm64 后
6.终端输入
./symbolicatecrash /Users/XXX/Desktop/crashTemp/crashLog.txt /Users/XXX/Desktop/crashTemp/ProjectName.app.dSYM > crashLogEnd.crash
出现 Error: "DEVELOPER_DIR" is not defined at ./symbolicatecrash line 69. 输入 export DEVELOPER_DIR="/Applications/XCode.app/Contents/Developer"
后再次输入
./symbolicatecrash /Users/XXX/Desktop/crashTemp/crashLog.txt /Users/XXX/Desktop/crashTemp/ProjectName.app.dSYM > crashLogEnd.crash
最后可以根据crashLogEnd.crash详细崩溃信息对程序进行修复
补充:
Exception Type: 异常类型
Exception Codes: 异常出错的代码(常见代码有以下几种)
0x8badf00d错误码:Watchdog超时, 看门狗定时器超时导致 Ate Bad Food
0xbaaaaaad错误码:用户按住Home键和音量键,获取当前内存状态,不代表崩溃。
0xbad22222错误码:VoIP应用被干掉。
0xc00010ff错误码:太热, “cool off”。
0xdead10cc错误码:在后台时仍然占据系统资源(通讯录)被干掉,意为“dead lock”。
0xdeadfa11错误码:用户强制退出,意为“dead fall”。
Triggered by Thread: 在某一个线程出了问题导致crash,Thread 0 为主线程、其它的都为子线程
Last Exception Backtrace: 最后异常回溯
网友评论