xamarin - 如何符号化 Xamarin Forms iOS 项目中的崩溃/错误日志?

标签 xamarin xamarin.ios xamarin.forms crash-reports symbolicate

我需要符号化一些崩溃日志,为此我读到我需要 .app 和 .dSYM 文件以及 .crash 文件。

我在任何地方都找不到 .app 文件。我有 .app.dSYM 文件和 .crash 文件,但我找不到 .app 文件。

我还可以在 Xcode Organizer 上查看错误日志。但我的应用程序中的行没有符号化。如果我单击箭头打开项目,我不知道要打开哪个文件。

谢谢

最佳答案

构建 iOS 项目时,bin/iPhone/Release 目录中应该有 .app 文件。或者,如果您有 .ipa 文件,则可以使用以下命令从中提取 .app。您可以将文件重命名为 .zip 并解压。 .app 将位于 Payload 文件夹中。在 Windows 上,这可能会有点令人困惑,因为图标可能看起来像文件夹或目录。检查文件扩展名。在 Mac 上,它应该识别 .app 并且可能根本不显示扩展名。相反,它看起来像这样:

enter image description here

Important: You need to use the same .app file that generated the crash report. This means you would have to use the .app from the package you installed on the device that generated the crash report. Hopefully, you archived that or saved it somewhere. Simply rebuilding the project to get a new .app will not match up with the .crash file during symbolication and will not work. If you don't have access to that, you will need to publish again and this time keep the .app around for the next time you get a .crash to analyze.

要手动符号化,我有一篇关于执行此操作的博客文章 here 。总而言之,步骤如下:

创建别名

打开终端并针对您的 Xcode 版本运行以下命令之一:

Xcode 7.X
alias symbolicate="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v"  

这只是通过将 symbolicatecrash 工具别名为符号命令来使使用它变得更容易,这样我们就不必导航到该目录来运行该命令。

更新开发者目录

运行此命令:

export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"

象征

再次打开终端并 cd 到您在上一步中放置文件的目录。运行我们之前使用 .crash 和 .app 文件作为参数的 symbolicate 命令,如下所示:

symbolicate -o "symbolicatedCrash.txt" "MyAppName 2-12-14, 9-44 PM.crash" "MyAppName.app"

这将符号化崩溃文件并将结果输出到名为“symbolicatedCrash.txt”的新文件中。确保更正我的示例中的文件名以与您的匹配。

关于xamarin - 如何符号化 Xamarin Forms iOS 项目中的崩溃/错误日志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38579117/

相关文章:

ios - 错误 MT2002 : Failed to resolve assembly: 'System.Drawing'

xamarin - 可以在 Xamarin PhotoView 组件中调整初始图像吗?

c# - 使用 C# 和 MonoTouch 制作 iOS 库或框架

android - 可绘制 xml 资源的 Xamarin.Forms Android Resources$NotFoundException

xamarin - 错误 MT2001 : Could not link assemblies. 原因:处理引用时出错

c# - 我的微调器没有显示我选择的值

Xamarin + sqlite-net 依赖错误

iphone - MonoTouch OpenGL 应用程序移动到后台时会丢失纹理数据

c# - Xamarin.Forms 将行插入到网格并重新排列

xamarin - 删除 Xamarin.Forms 中导航栏上方的蓝色栏