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:\IPad\Acs.RollsMary.Maroon.Core\Service References\PlaceService\Reference.cs:30064

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.Acs.RollsMary.Maroon.Core.PlaceService.IPlaceService_NotePad.EndGetDocumentByCategoryType (System.IAsyncResult result) [0x00001] in F:\IPad\Acs.RollsMary.Maroon.Core\Service References\PlaceService\Reference.cs:27734

at Acs.RollsMary.Maroon.Core.PlaceService.PlaceService_NotePadClient.OnEndGetDocumentByCategoryType (System.IAsyncResult result) [0x00001] in F:\IPad\Acs.RollsMary.Maroon.Core\Service References\PlaceService\Reference.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

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值