如何手动符号化 iOS 崩溃以查看崩溃日志

发布于 2024-09-25 22:25:39 字数 292 浏览 12 评论 0原文

尝试调试应用程序。问题是我找不到这个程序。

symbolicatecrash.sh

sudo cp /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/symbolicatecrash /usr/local/bin/

是单独下载的吗?我正在使用 XCode 3.2.3

谢谢。

Trying to debug app. The trouble is I cannot find this program.

symbolicatecrash.sh

sudo cp /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/symbolicatecrash /usr/local/bin/

Is it a separate download? I am using XCode 3.2.3

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

楠木可依 2024-10-02 22:25:39

编辑 :: XCode 4.3

您将需要遵循原始答案(如下)中概述的相同步骤,但有一些例外。

首先,您需要修复 Xcode 路径。打开终端并运行:

/usr/bin/xcode-select-print-path

如果它显示“/Developer”或除“/Applications/Xcode.app/Contents/Developer/”之外的任何内容,那么它是错误的。要修复此问题,请运行命令:

sudo /usr/bin/xcode-select -switch
/Applications/Xcode.app/Contents/Developer/

您现在可以运行以下所有步骤,但 symbolicatecrash 命令(再次)位于新位置。这是因为 Xcode 现在作为应用程序安装。 要查找symbolicatecrash,请从终端运行此命令

查找 /Applications/Xcode.app -name symbolicatecrash -type f

这应该返回:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

在运行 symbolicatecrash 之前,您可能希望转到这个目录就像:

光盘
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/


原始答案:: Xcode < 4.3

symbolicatecrash 的路径

使用以下命令从终端搜索:

查找 /Developer -name symbolicatecrash -type f

对于我来说,返回的是:

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

如何手动符号化崩溃日志

运行 symbolicatecrash 命令,并将崩溃日志作为第一个参数和 dSYM 文件作为第二个参数。请注意,如果您要从当前目录运行 symbolicatecrash,则必须将 ./ 放在前面,就像 ./symbolicatecrash 一样,除非您的 PATH 环境变量包括命令所在的目录。

我首先更改为包含 symbolicatecrash 命令的目录(注意:对于 Xcode 4.3 将有所不同,请参见顶部):

光盘
/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/

然后我执行了以下命令:

./symbolicatecrash /somePath/MyCrashLogFile.crash
/somePath/MyAppName.app.dSYM

如何查找 dSYM 文件:

您必须拥有用于创建崩溃构建的存档才能获取 dSYM 文件。

步骤如下:

  1. 右键单击​​(或 ctrl 单击)管理器中的存档,然后选择“在 Finder 中显示”。
  2. 从 Finder 中的 xcarchive 文件中,右键单击(或 ctrl 单击)该文件并选择“显示包内容”。然后您将看到一个“dSYMs”文件夹。
  3. 在“dSYMs”文件夹中,您将找到用于符号化文件的“YourAppName.app.dSYM”文件。

EDIT :: XCode 4.3

You will want to follow the same steps as outlined in the original answer (below) with a few exceptions.

First, you need to fix the Xcode path. Open a terminal and run:

/usr/bin/xcode-select -print-path

If it displays "/Developer" or anything but "/Applications/Xcode.app/Contents/Developer/" then it is wrong. To fix this run the command:

sudo /usr/bin/xcode-select -switch
/Applications/Xcode.app/Contents/Developer/

You can now run all the steps below, with the exception that the symbolicatecrash command is in a new spot (again). This is because Xcode now installs as an app. To find symbolicatecrash run this from the terminal:

find /Applications/Xcode.app -name symbolicatecrash -type f

This should return:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

Before running symbolicatecrash you may wish to go to this directory like:

cd
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/


Original Answer :: Xcode < 4.3

Path for symbolicatecrash

Search from a terminal using:

find /Developer -name symbolicatecrash -type f

For me this returned:

/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash

How to Manually Symbolicate a Crash Log

Run the symbolicatecrash command with the crash log as the first argument and your dSYM file as your second argument. Note that if you will be running symbolicatecrash from the current directory that you MUST put ./ in front like ./symbolicatecrash unless your PATH environment variable includes the directory that the command resides in.

I changed to the directory that had the symbolicatecrash command in it first (note: will be different for Xcode 4.3, see top):

cd
/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/

Then I executed the following command:

./symbolicatecrash /somePath/MyCrashLogFile.crash
/somePath/MyAppName.app.dSYM

How to Find the dSYM file:

You must have the archive that was used to create the build with the crash to get the dSYM file.

Here are the steps:

  1. Right click (or ctrl click) the archive from organizer and choose "Show in Finder".
  2. From the xcarchive file in finder, right click (or ctrl click) this file and choose "Show Package Contents". You will then see a "dSYMs" folder.
  3. Inside the "dSYMs" folder you will find "YourAppName.app.dSYM" file that you will need to symbolicate files.
怕倦 2024-10-02 22:25:39

产品菜单下有一个适用于 Xcode 的插件。该插件可通过 Alcatraz 包管理器 获取,也可以直接下载 来自 github

该插件内部包含一个 shell 脚本,用于设置运行以下命令以进行手动崩溃符号化。

  1. 设置 symbolicatecrash.pl perl 脚本的别名

别名
symbolicatecrash='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash'

  1. 要查找 symbolicatecrash,它是否与上面的别名不同:

查找 /Applications/Xcode.app -name symbolicatecrash -type f

  1. 设置 DEVELOPER_DIR 变量:

导出 DEVELOPER_DIR='/Applications/Xcode.app/Contents/Developer'

  1. 使用 dSYM,崩溃可以表示为:

symbolicatecrash /path/to/MyApp_2012-10-01_Device.crash
/path/to/MyApp.app.dSYM。

A plugin is available for Xcode under the Product menu. This plugin is available through Alcatraz package manager or can be directly downloaded from github.

This plugin internally incorporates a shell script that does the set up of running the following commands for manual crash symbolication.

  1. Set an alias to symbolicatecrash.pl perl script

alias
symbolicatecrash='/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash'

  1. To find symbolicatecrash, should it differ from the alias above:

find /Applications/Xcode.app -name symbolicatecrash -type f

  1. Set the DEVELOPER_DIR variable:

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

  1. With the dSYM the crash can be symbolicates as:

symbolicatecrash /path/to/MyApp_2012-10-01_Device.crash
/path/to/MyApp.app.dSYM.

疾风者 2024-10-02 22:25:39

表示崩溃日志的一种方法是在终端上运行以下命令:

xcrun atos -o MyApp.app/MyApp -arch armv7 -l 0xb7000 -f MyApp.crash

将上述命令中的示例十六进制数字 (0xb700) 替换为基本负载地址。 之后的行中的第一个内存地址

基本加载地址是紧随“二进制图像:”

要获取 .app 文件:

右键单击 xcarchive 文件并选择“显示包内容 ”
.app 文件位于 Products/Applications 目录中。

One way to symbolicate a crash log is to run the following command on terminal:

xcrun atos -o MyApp.app/MyApp -arch armv7 -l 0xb7000 -f MyApp.crash

Replace the example hexadecimal number(0xb700) in the command above with the base load address. Base load address is the first memory address in the line immediately after

"Binary Images:"

To get the .app file:

Right click on the xcarchive file and select Show Package Contents
The .app file is in the Products/Applications directory.

云淡月浅 2024-10-02 22:25:39

5 分钟前我刚刚在这里写了一篇关于调试崩溃日志的文章:http://just2us。 com/2010/10/reading-iphone-crashlog/

如果将日志拖放到 Xcode 足以满足您的目的,您可能不再需要 symbolicatecrash.sh。我用的是3.2.4,也找不到脚本。

I just wrote a post on debugging crash log 5 min ago here: http://just2us.com/2010/10/reading-iphone-crashlog/

You might not need symbolicatecrash.sh anymore if drag and drop the logs to Xcode is good enough for your purpose. I am using 3.2.4, and I can't find the script too.

禾厶谷欠 2024-10-02 22:25:39

正如 Apple 所解释的,Xcode 将尝试自动符号化。 它使用symbolicatecrash 和聚光灯来做到这一点。但是,如果应用程序不是本地构建的或已被删除,则必要的 .app 和 .dsym 文件不可用。

因此,请保留 dsym 文件和已发布版本的应用程序。构建工具通常会将 .dsym 文件压缩为 .dsym.zip 并将 .app 打包为 .ipa。您可以将两者解压缩并将 .app 和 .dsym 复制到同一文件夹中。然后 Xcode 将能够使用聚光灯找到它们。

As Apple explains, Xcode will try to symbolicate automatically. It uses symbolicatecrash and spotlight to do that. However if the app wasn't built locally or it was deleted, then the necessary .app and .dsym files are not available.

So keep around the dsym file and the app of released versions. Build tools will often zip the .dsym file to a .dsym.zip and package the .app as an .ipa. You can unzip both and copy .app and .dsym to the same folder. Then Xcode will be able to find them using spotlight.

梦罢 2024-10-02 22:25:39

这是我使用的一个简单方法:

  1. 打开 Xcode 6
  2. 插入您的开发设备
  3. 在 Xcode 中,转到 Window >设备>选择您的设备
  4. 按“查看设备日志”
  5. 将报告拖到窗口中进行查看

Here is a simple method I use:

  1. Open Xcode 6
  2. Plug in your dev device
  3. Within Xcode, go to Window > Devices > Select your device
  4. Press 'View Device Logs'
  5. Drag your report into the window to view it
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文