如何导入和符号化此 Xcode 6.3.1 的崩溃报告?

How do I import and symbolicate a crash report on this Xcode 6.3.1?

如何在此 Xcode 6.3 上导入崩溃日志?我的所有应用程序在苹果服务器上的崩溃都是零,或者我是一个程序员天才,我的应用程序崩溃是零,或者某些东西没有工作Xcode(惊喜!)。

无论如何,一位客户从我的一个应用程序 Mac 向我发送了崩溃日志,但我不知道如何将此崩溃日志导入这个令人惊叹的新 Xcode 6.3?

有什么线索吗?

如果您有自己的崩溃报告文件并想导入 Xcode,您仍然必须以旧的(有缺陷的)方式进行。

编辑:我刚看到你说 Mac 个应用程序。您应该能够从设备 window 的左窗格中 select 您的 Mac 而不是插入 iOS 设备。

  • 转到 Window -> 设备并使用 USB 插入 iOS 设备 电缆。
  • Select 左侧窗格中的设备 Select “查看设备 日志”按钮
  • Select "All Logs" 从左侧窗格的顶部拖动 您的崩溃报告到左窗格,到崩溃报告列表。
  • 您会看到一个绿色的 + 号。等待几分钟,它应该 在那里并被象征化。

有时我不得不通过离开页面并返回或select发送不同的崩溃报告来强制刷新列表。

在我的头撞墙之后,我看到,感谢 Apple,现在不可能从文件中符号化崩溃日志。在以前的 Xcode 版本上可以,但在 6.3 上不行。 Apple 删除了该功能。

到目前为止,我只有尝试自动符号化崩溃日志文件的命令行脚本:

#!/bin/sh

export DEVELOPER_DIR=$(xcode-select --print-path) # set the developer dir, this will be used by the symbolicator script
SYMBOLICATOR=($(find /Applications/Xcode.app/ -name "symbolicatecrash")) #find the symbolicatecrash script from Xcode
DIR="$( cd "$( dirname "[=10=]" )" && pwd )" 
mdimport "/dSymFiles" #<-- put folder of your stored dsym files here

while true; do
    for i in $DIR/*.crash; do # for all crash logs, case sensitive extension        
        sudo chmod 777 $i
        o="$i".txt

        if [ $i -nt $o ]
        then
            echo "Symbolicate $i"
            perl $SYMBOLICATOR -o $o $i
        fi 
    done    
    sleep 1 
done

您可以将崩溃日志 (*.crash) 放入与此脚本相同的文件夹中。同时删除空格和其他怪人 cr 我没有找到合适的方法 "manually" 使用 Xcode 符号化崩溃日志。

这为我解决了:

If you plug in /any/ device then select the device in the Devices window and click View Device Logs, you should be able to drag the crash report into the resulting sheet.

https://forums.developer.apple.com/thread/11473

这是我使用命令行来表示崩溃的工作流程。它适用于 Xcode 12.3 和 macOS 10.15.7。我正在象征一个桌面应用程序,所以对我来说,在 Xcode 中使用设备和模拟器 window 是行不通的(至少我想不出来),但我认为这个工作流程是最通用,例如,即使有人只是发送崩溃的屏幕截图,它也能正常工作 window!

首先,您需要一个包含应用程序和符号的文件夹;例如,创建一个文件夹(例如app)并将应用程序(例如MyApp.app)和.app.dSYM 包(例如MyApp.app.dSYM)复制到其中。两者都在 Xcode 存档中可用(如果符号包含在构建设置中):Xcode > Organizer > 右键单击​​存档 > 在 Finder 中显示 > 右键单击​​ xarchive 文件 > 显示包内容, 找到提到的文件。

崩溃日志包含以下列的回溯: stack #, binary image name, address, load address, line offset (我认为), eg

0 MyApp 0x102d2e106 0x102d0b000 + 143622

要获取该行的符号,请使用 atos 命令,传入应用程序的二进制可执行文件、崩溃日志的体系结构、加载地址和要符号化的地址,例如:

atos -o app/MyApp.app/Contents/MacOS/MyApp -arch x86_64 -l 0x102d0b000 0x102d2e106

一个有用的提示是,如果您省略地址(最后一个参数),atos 将从提示中读取地址,因此只需粘贴它们并按回车键即可。或者,您可以在 atos 命令的末尾添加几个地址(带空格),该命令将打印出这些行。

要获取 arch 字符串,请在堆栈跟踪下方的崩溃日志中查找 arch,并在堆栈跟踪中选择其名称与二进制图像名称匹配的记录。如果您将其关闭,它会假定它与计算机具有相同的体系结构。对于 iPhone 和 iPad 我相信它是 arm64,Intel 是 x86_64,我不知道不知道要为 Apple Silicon 添加什么。来自手册页:

It is possible to get symbols for addresses from a different machine architecture than the system on which atos is running. For example, when running atos on an Intel- based system, one may wish to get the symbol for an address that came from a backtrace of a process running on an ARM device. To do so, use the -arch flag to specify the desired architecture (such as i386 or arm) and pass in a corresponding symbol-rich Mach-O binary image file with a binary image of the corresponding architecture (such as a Universal Binary).

更多信息在这里:https://developer.apple.com/documentation/xcode/adding-identifiable-symbol-names-to-a-crash-report#Symbolicate-the-Crash-Report-with-the-Command-Line

也用man atos