我是靠谱客的博主 仁爱紫菜,最近开发中收集的这篇文章主要介绍ios 捕抓crash_Xamarin.ios 手动捕获到的crash符号化的问题,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

ios设备产生的crash文件根据Archives或者dSYM文件符号化成可识别的内容网上很多,但是这里要问的不是这个。因为app只是内部系统,并没有放到Appstore中,因此不能使用Appstore的crash收集功能。于是叫客户手动获取crash并发给我们。一开始客户还是愿意手动把crash给过来的,但是后面开始嫌麻烦,让我们做自动上传的功能。但是ios貌似是不允许app操作crash文件的,于是就有了下面的代码出现,自己手动捕获。废话不多说,上代码。

public classApplication

{//This is the main entry point of the application.

static void Main (string[] args)

{//if you want to use a different Application Delegate class from "AppDelegate"//you can specify it here.

try{

UIApplication.Main(args,null, "AppDelegate");

}catch(Exception ex) {string documents =Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);string filename = Path.Combine(documents, "myCrash.txt");string splitString = "#split#";string content = ex.ToString() + splitString + DateTime.Now.ToString() + splitString + (LoginInfo.wUserCName ?? "")+ splitString + (LoginInfo.wVersion ?? "");

File.WriteAllText(filename, content);

}

}

}

简单粗暴,确实能捕获到一些有用信息(只能捕获到主线程的,因此如果子线程有可能会crash的操作,对子线程try/catch,并在catch中BeginInvokeOnMainThread把exception throw 出来)。全局捕获异常并记录下来,下次打开app的时候通过wcf上传到DB中。然而,调试环境下产生完全可读的错误,在真机中却是会有部分未符号化的内容。

这个是调试环境捕获到的crash:

System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.TimeoutException: The operation has timed out.

at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)

at (wrapper delegate-end-invoke) :end_invoke_object__this___object[]&_IAsyncResult (object[]&,System.IAsyncResult)

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters, System.IAsyncResult result) [0x00025] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.8.0.175/src/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientRuntimeChannel.cs:460

at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object[] args, System.IAsyncResult result) [0x0003c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.8.0.175/src/mono/mcs/class/System.ServiceModel/System.ServiceModel/ClientBase.cs:404

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient+PlaceService_NotePadClientChannel.EndGetDocumentByCategoryType (System.IAsyncResult result) [0x00008] in F:IPadAcs.RollsMary.Maroon.CoreService ReferencesPlaceServiceReference.cs:30064

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.Acs.RollsMary.Maroon.Core.PlaceService.IPlaceService_NotePad.EndGetDocumentByCategoryType (System.IAsyncResult result) [0x00001] in F:IPadAcs.RollsMary.Maroon.CoreService ReferencesPlaceServiceReference.cs:27734

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.OnEndGetDocumentByCategoryType (System.IAsyncResult result) [0x00001] in F:IPadAcs.RollsMary.Maroon.CoreService ReferencesPlaceServiceReference.cs:27743

这个是真机中捕获到的crash:

System.Reflection.TargetInvocationException: An exception occurred during the operation, making the result invalid. Check InnerException for exception details. ---> System.TimeoutException: The operation has timed out.

at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_delegate_end_invoke (object,intptr)

at (wrapper delegate-end-invoke) :end_invoke_object__this___object[]&_IAsyncResult (object[]&,System.IAsyncResult)

at System.ServiceModel.MonoInternal.ClientRuntimeChannel.EndProcess (System.Reflection.MethodBase method, System.String operationName, System.Object[] parameters, System.IAsyncResult result) <0x100e1b980 + 0x0004b> in <220dfdb330c54319abf8948e4174d84b#565b21b1fe7c3ca144f793b1f2b173e0>:0

at System.ServiceModel.ClientBase`1+ChannelBase`1[TChannel,T].EndInvoke (System.String methodName, System.Object[] args, System.IAsyncResult result) <0x100e112b0 + 0x00087> in <220dfdb330c54319abf8948e4174d84b#565b21b1fe7c3ca144f793b1f2b173e0>:0

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient+PlaceService_NotePadClientChannel.EndGetDocumentByCategoryType (System.IAsyncResult result) <0x100a52600 + 0x00043> in :0

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.Acs.RollsMary.Maroon.Core.PlaceService.IPlaceService_NotePad.EndGetDocumentByCategoryType (System.IAsyncResult result) <0x100a40ef0 + 0x00043> in :0

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.OnEndGetDocumentByCategoryType (System.IAsyncResult result) <0x100a41010 + 0x0003b> in :0

眼尖的你们应该能发现那些未被符号化的东东了,这就是我这里要提问的问题:如何把这些基址和偏移符号化。网上找的最接近的应该就是说用xcode自带的atos,但我试过这个貌似还是符号化不了。

https://www.cnblogs.com/MatyLin/p/7814718.html

有没有对这方面比较了解的前辈指导下。

最后

以上就是仁爱紫菜为你收集整理的ios 捕抓crash_Xamarin.ios 手动捕获到的crash符号化的问题的全部内容,希望文章能够帮你解决ios 捕抓crash_Xamarin.ios 手动捕获到的crash符号化的问题所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(53)

评论列表共有 0 条评论

立即
投稿
返回
顶部