获取崩溃线程,然后对线程信息做处理得出崩溃唯一标识
# 这块暂时不做容错,默认crash均是完整
lastExceptionBacktrace = re.search(r"Last Exception Backtrace:(.+?)Thread ", c_content, re.S)
if lastExceptionBacktrace:
crash_info["crash_thread_detial"] = lastExceptionBacktrace.group(1).strip()
else:
try:
crash_info["crash_thread_detial"] = re.search(r'Crashed:(.+?)Thread ',c_content ,re.S).group(1).strip()
except:
print "no Crashed word:",crashPath
return None
获取系统版本
crash_info["os_version"] = re.search(r"OS Version:(.+)", c_content).group(1).strip()
获取设备硬件信息
crash_info["hardware"] = re.search(r"Hardware Model:(.+)", c_content).group(1).strip()
INTERNAL_NAME = {
# iPhone 映射关系
"iPhone1,1": "iPhone",
"iPhone1,2": "iPhone 3G",
"iPhone2,1": "iPhone 3GS",
"iPhone3,1": "iPhone 4",
"iPhone3,2": "iPhone 4",
"iPhone3,3": "iPhone 4",
"iPhone4,1": "iPhone 4S",
"iPhone5,1": "iPhone 5",
"iPhone5,2": "iPhone 5",
"iPhone5,3": "iPhone 5c",
"iPhone5,4": "iPhone 5c",
"iPhone6,1": "iPhone 5s",
"iPhone6,2": "iPhone 5s",
"iPhone7,2": "iPhone 6",
"iPhone7,1": "iPhone 6 Plus",
"iPhone8,1": "iPhone 6s",
"iPhone8,2": "iPhone 6s Plus",
# iPad 映射关系
"iPad1,1": "iPad",
"iPad2,1": "iPad 2",
"iPad2,2": "iPad 2",
"iPad2,3": "iPad 2",
"iPad2,4": "iPad 2",
"iPad3,1": "iPad 3",
"iPad3,2": "iPad 3",
"iPad3,3": "iPad 3",
"iPad3,4": "iPad 4",
"iPad3,5": "iPad 4",
"iPad3,6": "iPad 4",
"iPad4,1": "iPad Air",
"iPad4,2": "iPad Air",
"iPad4,3": "iPad Air",
"iPad5,3": "iPad Air 2",
"iPad5,4": "iPad Air 2",
"iPad6,7": "iPad Pro",
"iPad6,8": "iPad Pro"
}
crash_info["app_version"] = re.search(r"Version:(.+)", c_content).group(1).strip()