如何手动符号化 iOS 崩溃以查看崩溃日志
尝试调试应用程序。问题是我找不到这个程序。
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
编辑 :: XCode 4.3
您将需要遵循原始答案(如下)中概述的相同步骤,但有一些例外。
首先,您需要修复 Xcode 路径。打开终端并运行:
如果它显示“/Developer”或除“/Applications/Xcode.app/Contents/Developer/”之外的任何内容,那么它是错误的。要修复此问题,请运行命令:
您现在可以运行以下所有步骤,但
symbolicatecrash
命令(再次)位于新位置。这是因为 Xcode 现在作为应用程序安装。 要查找symbolicatecrash
,请从终端运行此命令:这应该返回:
在运行
symbolicatecrash
之前,您可能希望转到这个目录就像:原始答案:: Xcode < 4.3
symbolicatecrash 的路径
使用以下命令从终端搜索:
对于我来说,返回的是:
如何手动符号化崩溃日志
运行
symbolicatecrash
命令,并将崩溃日志作为第一个参数和 dSYM 文件作为第二个参数。请注意,如果您要从当前目录运行symbolicatecrash
,则必须将./
放在前面,就像./symbolicatecrash
一样,除非您的 PATH 环境变量包括命令所在的目录。我首先更改为包含
symbolicatecrash
命令的目录(注意:对于 Xcode 4.3 将有所不同,请参见顶部):然后我执行了以下命令:
如何查找 dSYM 文件:
您必须拥有用于创建崩溃构建的存档才能获取 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:
If it displays "/Developer" or anything but "/Applications/Xcode.app/Contents/Developer/" then it is wrong. To fix this run the command:
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 findsymbolicatecrash
run this from the terminal:This should return:
Before running
symbolicatecrash
you may wish to go to this directory like:Original Answer :: Xcode < 4.3
Path for symbolicatecrash
Search from a terminal using:
For me this returned:
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 runningsymbolicatecrash
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):Then I executed the following command:
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:
产品菜单下有一个适用于 Xcode 的插件。该插件可通过 Alcatraz 包管理器 获取,也可以直接下载 来自 github。
该插件内部包含一个 shell 脚本,用于设置运行以下命令以进行手动崩溃符号化。
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.
表示崩溃日志的一种方法是在终端上运行以下命令:
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.
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.
正如 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.
这是我使用的一个简单方法:
Here is a simple method I use: