iOS审核崩溃及设置IPv6,日志分析
当后台审核遇到崩溃被拒绝的时候:
1:查看拒绝原因
Guideline 2.1 - Performance
Your app crashed on iPad or iPhone running iOS 11.2.5 connected to an IPv6 network during our review.
We have attached detailed crash logs to help troubleshoot this issue.
Next Steps
To resolve this issue, please revise your app and test it on a device to ensure that it runs as expected.
2:下载崩溃日志
attachmentlog2018.crash
3:分析拒绝原因
在我们审核期间,您的应用在IPv6网络上运行iOS 11.2.5的iPad或iPhone上崩溃。
拒绝原因有两个地方: 崩溃 和 IPv6
关于崩溃,后面会分析日志
关于IPv6,有两种关键词的情况:
1:是IPv6 //意思是出现bug的时候网络是IPv6下,可能IPv4下也会
2:是IPv6only //意思是出现bug的时候网络只有IPv6下会
上面第一种情况需要同时测试APP性能和IPv6下运行情况
上面第二种情况优先测试IPv6下运行情况
4: 分析崩溃日志
设备:MacPro 和 iPhone
准备工作:
在电脑上创建文件夹crash
将崩溃日志文件attachmentlog2018.crash放到文件夹crash里
打开Xcode代码,Window -> Organizer
找到对应的审核版本(根据版本号和build号),右键进入文件夹:
图片.png右键进入包内容:
图片.png
将下面两个文件也copy到crash文件夹里:
app.dSYM APP
打开Finder,前往文件夹:复制symbolicatecrash文件
/应用程序/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash
开始执行命令生成log文件:
cd /Users/niexiaobo/Downloads/Crach
./symbolicatecrash ./.crash ./.dSYM > crash20180308.log
如果报错了,执行下面命令:
export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
再执行:
./symbolicatecrash ./.crash ./.dSYM > crash20180308.log
成功的话文件夹里有个crash20180308.log
[ 也许你可以选择: 比如使用QuincyKit, Crashlytics, Flurry等来进行管理 ]
打开文件crash20180308.log,分析log:
log开头是一段设备信息:
{"app_name":"...Pro","timestamp":"2018-03-01 13:42:48.28 -0800","app_version":"2.0.1",
"slice_uuid":"9a25......abeed","adam_id":0,"build_version":"66",
"bundleID":"co....tree","share_with_app_devs":false,"is_first_party":false,
"bug_type":"109","os_version":"iPad OS 11.2.5 (15D60)",
"incident_id":"5557....E741D6F13BE1","name":"Ar...o"}
Incident Identifier: 55570142-FB5E-...41D6F13BE1
CrashReporter Key: 73005e1b4c91...44bc3e9d4eb00
Hardware Model: iPad6,12
Device Model: J72sAP
Process: A...Pro [14318]
Path: /private/var/containers/Bundle/Application/6B0611AE-936B-4EC3-A1BA-1..eePro.app/ArTreePro
Identifier: co...ree
Version: 66 (2.0.1)
Code Type: ARM-64 (Native)
Role: Foreground
Parent Process: launchd.development [1]
Coalition: co...ree [1208]
Date/Time: 2018-03-01 13:42:48.1816 -0800
Launch Time: 2018-03-01 13:42:26.8537 -0800
OS Version: iPhone OS 11.2.5 (15D60)
Baseband Version: 6.30.04_DEBUG
UDID: fcaabee664b44d7...468075
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Application Specific Information:
terminate_handler unexpectedly threw an exception
abort() called
提取信息:
Hardware Model: iPad6,12
崩溃信息1:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
搜索关键词Last Exception Backtrace查看日志:
Last Exception Backtrace:
0 CoreFoundation 0x185d83164 __exceptionPreprocess + 124 (NSException.m:166)
1 libobjc.A.dylib 0x184fcc528 objc_exception_throw + 56 (objc-exception.mm:521)
2 CoreFoundation 0x185d90628 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:322)
3 CoreFoundation 0x185d88b10 ___forwarding___ + 1380 (NSForwarding.m:3220)
4 CoreFoundation 0x185c6dccc _CF_forwarding_prep_0 + 92
5 UIKit 0x1a50ad724 -[UITableViewAccessibility _accessibilitySupplementaryHeaderViews] + 284 (UITableViewAccessibility.m:510)
6 UIAccessibility 0x197165f54 -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSupplementaryViews:] + 112 (UIAccessibilityAutomation.m:265)
7 UIAccessibility 0x197166190 -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingChildrenCount] + 128 (UIAccessibilityAutomation.m:291)
8 UIAccessibility 0x19713d4ec -[NSObject(AXPrivCategory) accessibilityAttributeValue:] + 1716 (NSObjectAccessibility.m:5123)
9 UIAccessibility 0x197167184 -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotDescendantsWithAttributes:maxDepth:maxChildren:maxArrayCount:] + 2192 (UIAccessibilityAutomation.m:606)
10 UIAccessibility 0x197168f08 -[NSObject(UIAccessibilityAutomation) _accessibilityUserTestingSnapshotWithOptions:] + 640 (UIAccessibilityAutomation.m:779)
11 UIAccessibility 0x19713c268 -[NSObject(AXPrivCategory) accessibilityAttributeValue:forParameter:] + 8836 (NSObjectAccessibility.m:4304)
12 UIAccessibility 0x19711bc80 _copyParameterizedAttributeValueCallback + 224 (UIAccessibilityRuntime.m:752)
13 AXRuntime 0x195392ad0 ___AXXMIGCopyParameterizedAttributeValue_block_invoke + 100 (AccessibilityPriv.m:1128)
14 AXRuntime 0x195392238 _handleNonMainThreadCallback + 60 (AccessibilityPriv.m:363)
15 AXRuntime 0x195392924 _AXXMIGCopyParameterizedAttributeValue + 344 (AccessibilityPriv.m:1127)
16 AXRuntime 0x19538d220 _XCopyParameterizedAttributeValue + 380 (AccessibilityClientDefsServer.c:1160)
17 AXRuntime 0x19539f28c mshMIGPerform + 252 (MachServerHelper.c:448)
18 CoreFoundation 0x185d2be00 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56 (CFRunLoop.c:1998)
19 CoreFoundation 0x185d2b504 __CFRunLoopDoSource1 + 440 (CFRunLoop.c:2135)
20 CoreFoundation 0x185d28fd8 __CFRunLoopRun + 2196 (CFRunLoop.c:3150)
21 CoreFoundation 0x185c48c58 CFRunLoopRunSpecific + 436 (CFRunLoop.c:3245)
22 GraphicsServices 0x187af4f84 GSEventRunModal + 100 (GSEvent.c:2245)
23 UIKit 0x18f3a15c4 UIApplicationMain + 236 (UIApplication.m:3956)
24 ArTreePro 0x000000010479dd40 main + 3382591 (main.m:14)
其中2可以看出是doesNotRecognizeSelector导致的:
2 CoreFoundation 0x185d90628 -[NSObject(NSObject) doesNotRecognizeSelector:] + 140 (NSObject.m:322)
接着是:[UITableViewAccessibility _accessibilitySupplementaryHeaderViews],可能和tableview加载有关.
然后分析原因并处理.
5: 链接IPv6进行测试
大家可以网上搜索教程,在此我用MacPro笔记本和iPhone各一台测试
打开电脑的偏好设置
进入共享
共享
选择互联网共享按钮时,弹出提示框,开启共享,最后如下图:
互联网共享
把手机或者ipad设备设置飞行模式,再通过USB链接电脑,接着运行APP就可以了.
注意:
关于IPv6问题,有人是通过VPN把域名映射到美国,也可能是没有写域名,直接写了ip地址,等等
上面设置只是国内服务器,而审核人员是美国加州的外网IPv6下测试,需要链接vpn设置.