背景
在iOS 9 的日誌裏面會出現重複的 ParsecSubscriptionServiceSupport 或 AssetCacheServices , 這導致蘋果提供的symbolicatecrash轉換時出現卡死。
原因
這是由於xcode提供的symbolicatecrash對於重複image的日誌會出現死循環。
解決方法:
在 XCode目錄,找到 symbolicatecrash 文件:
/Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash
使用編輯器進行編輯,
將以下代碼:
# add ourselves to that chain
$images{$nextIDKey}{nextID} = $image{base};
# and store under the key we just recorded
$bundlename = $bundlename . $image{base};
替換爲:
if ($image{uuid} ne $images{$bundlename}{uuid}) {
# add ourselves to that chain
$images{$nextIDKey}{nextID} = $image{base};
# and store under the key we just recorded
$bundlename = $bundlename . $image{base};
}
懶人的解決方法:
在命令行輸入如下腳本,可修改默認的xcode的symbolicatecrash 文件(可能需要輸入管理員密碼):
curl -o /tmp/t.patch https://raw.githubusercontent.com/zqxiaojin/OptSymbolicatecrash/master/fix_dead_loop.patch && cd `xcode-select -p`/../SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/ && sudo patch symbolicatecrash /tmp/t.patch && cd -