Xcode 5的管理器有一个视图,可以列出所有的崩溃日志。我们可以拖放这里的崩溃日志。但自从Xcode 6以来,我知道他们已经将设备移出了组织,并为相同的设置了一个新的窗口。但我没有找到一个地方,我查看崩溃日志,我拖拽在Xcode 5后上升到Xcode 6。有人知道答案吗?
好的,我意识到你可以这样做:
在Xcode > Window > Devices中,选择连接的iPhone/iPad/etc左上角。 查看设备日志 所有日志
您可能在那里有很多日志,为了便于稍后找到导入的日志,您可以在此时删除所有日志……除非他们对你来说意味着金钱。或者除非你知道崩溃发生的确切时间点——无论如何都应该写在文件中……我很懒,所以我只是删除所有旧的日志(这实际上花了一段时间)。
3 a。确保日志文件的扩展名为.crash(而不是.txt或.ips)
只需将文件拖放到该列表中。这对我很管用。
写这个答案既是为了社区,也是为了我自己。
如果在事故报告中出现了问题,可以通过以下方法加以解决:
创建一个单独的文件夹,复制Foo。app和Foo.app.dSYM从对应的.xcarchive文件夹中。同时将.crash报告复制到文件夹中。 在TextEdit或其他地方打开崩溃报告,转到Binary Images:部分,并复制第一个地址(例如0xd7000)。 CD放入文件夹。现在可以执行如下命令: xrun atos -o Foo。app/Foo -arch arm64 -l 0xd7000 0x0033f9bb .使用实例
这将表示地址为0x0033f9bb的符号。请确保为-arch选项选择正确的值(可以从Binary Images:部分中的第一行获得,或从硬件模型:在崩溃报告和应用程序支持的arch中计算出来)。
你也可以直接从崩溃报告中复制必要的地址(例如线程调用堆栈)到一个文本文件中(在TextEdit中,按住Option并选择必要的文本块,或者复制并剪切),得到如下内容:
0x000f12fb
0x002726b7
0x0026d415
0x001f933b
0x001f86d3
现在你可以将它保存到一个文本文件中,例如addr.txt,并运行以下命令:
xcrun atos -o Foo.app/Foo -arch arm64 -l 0xd7000 -f addr.txt
这将为所有地址一次提供一个很好的符号化。
P.S.
在执行上述操作之前,值得检查是否正确设置了所有内容(因为atos会很高兴地为基本上任何提供的地址报告一些内容)。
要进行检查,请打开崩溃报告,并转到线程0的调用堆栈的末尾。从末尾开始列出你的应用程序的第一行(通常是第二行),例如:
34 Foo 0x0033f9bb 0xd7000 + 2525627
应该是main()调用。如上所述,将地址(在本例中为0x0033f9bb)标记为符号应该确认这确实是main(),而不是某个随机方法或函数。
如果地址不是main(),检查你的加载地址(-l选项)和arch (-arch选项)。
P.P.S.
如果上面因为bitcode而不能工作,请从iTunes Connect下载dSYM,从dSYM (Finder > Show Package Contents)中提取可执行二进制文件,将其复制到目录中,并使用它(即Foo)作为atos的参数,而不是Foo.app/Foo。
你也可以参考这个,我已经写了手动崩溃重新符号化的步骤。
崩溃Re-Symbolication
步骤1
移动上面所有的文件(MyApp。应用,MyApp-dSYM。dSYM和MyApp-Crash-log.crash)到一个文件夹,有一个方便的名字,你可以很容易地使用终端。
对我来说,桌面是最容易到达的地方;) 所以,我已经把这三个文件移动到桌面的MyApp文件夹。
步骤2
现在轮到Finder了,去到下面的路径,无论哪个适用于你的XCODE版本。
使用此命令查找symbolicatecrash脚本文件, 找到/应用程序/ Xcode。应用程序名称symbolicatcrash
Xcode 7.3和更新版本(Xcode 8,…, Xcode 14,…):/ application /Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash
步骤3
将找到的symbolicatecrash脚本文件的目录添加到$PATH env变量中,如下所示d/ xcode - symbolicatcrash,粘贴脚本文件的目录并保存。当打开一个新终端时,您可以在位于/usr/bin中的任何文件夹中调用symbolicatecrash命令。
Or
复制符号崩溃文件从这个位置,并将其粘贴到桌面/MyApp (等等……不要盲目地跟着我,我正在MyApp文件夹中粘贴符号崩溃文件,这是你在第一步中创建的,在你最喜欢的位置,有三个文件。)
步骤4
打开终端,并CD到MyApp文件夹。
cd Desktop/MyApp — Press Enter
export DEVELOPER_DIR=$(xcode-select --print-path)
—按Enter
./symbolicatecrash -v MyApp-Crash-log.crash MyApp.dSYM
—按Enter
就是这样!符号日志在您的终端上… 现在简单地,找出错误并解决它;)
使用Xcode有一个更简单的方法(不需要使用命令行工具,一次查找一个地址)
Take any .xcarchive file. If you have one from before you can use that. If you don't have one, create one by running the Product > Archive from Xcode. Right click on the .xcarchive file and select 'Show Package Contents' Copy the dsym file (of the version of the app that crashed) to the dSYMs folder Copy the .app file (of the version of the app that crashed) to the Products > Applications folder Edit the Info.plist and edit the CFBundleShortVersionString and CFBundleVersion under the ApplicationProperties dictionary. This will help you identify the archive later Double click the .xcarchive to import it to Xcode. It should open Organizer. Go back to the crash log (in Devices window in Xcode) Drag your .crash file there (if not already present) The entire crash log should now be symbolicated. If not, then right click and select 'Re-symbolicate crash log'
苹果公司的文件如下:
符号崩溃报告与Xcode Xcode会自动尝试符号化它遇到的所有崩溃报告。你所需要做的就是将崩溃报告添加到Xcode管理器中。
Connect an iOS device to your Mac Choose "Devices" from the "Window" menu Under the "DEVICES" section in the left column, choose a device Click the "View Device Logs" button under the "Device Information" section on the right hand panel Drag your crash report onto the left column of the presented panel Xcode will automatically symbolicate the crash report and display the results To symbolicate a crash report, Xcode needs to be able to locate the following: The crashing application's binary and dSYM file. The binaries and dSYM files for all custom frameworks that the application links against. For frameworks that were built from source with the application, their dSYM files are copied into the archive alongside the application's dSYM file. For frameworks that were built by a third-party, you will need to ask the author for the dSYM file. Symbols for the OS that the that application was running on when it crashed. These symbols contain debug information for the frameworks included in a specific OS release (e.g, iOS 9.3.3). OS symbols are architecture specific - a release of iOS for 64-bit devices won't include armv7 symbols. Xcode will automatically copy OS symbols from each device that you connect to your Mac.
如果其中任何一个缺失,Xcode可能无法代表这个崩溃报告,或者只能部分代表这个崩溃报告。
对我来说,.crash文件就足够了。没有。dsym文件和。app文件。
我在mac上运行了这两个命令,在那里我建立了存档,它工作了:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash /yourPath/crash1.crash > /yourPath/crash1_symbolicated.crash
您需要访问包含DWARF文件的. dsym包(文件夹),并且应该使用编辑器打开.crash文件。
查看回溯部分,你应该会看到如下内容:
...
13 TheElements 0x0000000100f62ca0 0x100f5c000 + 27808
14 UIKitCore 0x00000001843e3044 -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 356 (UIApplication.m:2328)
...
Binary Images:
0x100f5c000 - 0x101673fff TheElements arm64 ...
...
注意stacktrace部分的第3列(0x0000000100f62ca0)中的长地址。 注意第4列中的简短地址(0x100f5c000) 注意二进制图像部分的架构(arm64) 执行以下操作:
$ atos -arch <arch> -o TheElements.app.dSYM/Contents/Resources/DWARF/TheElements -l <short_address> <long_address>
你应该得到这样的结果:
-[AtomicElementViewController myTransitionDidStop:finished:context:]
权威来源:https://developer.apple.com/library/content/technotes/tn2151/_index.html#//apple_ref/doc/uid/DTS40008184-CH1-SYMBOLICATE_WITH_ATOS
注意:如果由于任何原因你无法访问. dsym文件,你可以使用Xcode>Product>Archive重新创建.xcarchive,但要确保你构建的是完全相同的代码。然后可以从.xcarchive包中提取符号。
对崩溃日志进行符号化的最简单方法:
在IPA构建过程中保存组织者的xcarchive文件,以备将来使用。 当崩溃发生时,从受影响的设备上收集崩溃日志。扩展名应该是.crash。如果崩溃日志是.ips格式,只需将其重命名为.crash。 双击存储路径中的xcarchive,使其出现在管理器中(如果尚未出现)。 打开xcode窗口->设备和模拟器->查看设备日志->所有日志->拖放.crash文件。
等待5秒。砰!堆栈跟踪中的应用程序调用将被符号化! 不过,你仍然可以看到很多符号!这些是内部库和框架调用。
这是最简单的一种方法,我已经试过了!
在Xcode 10中遵循以下步骤,在同一台机器上生成应用程序的崩溃日志:
Inside Organizer, locate the archive where the app is based on. Click on the Download Debug Symbols button. Nothing will appear in your Downloads folder, but that's OK. Connect the build machine to an iOS device. Select the device in Devices and Simulators. Click on the View Devices Logs button. Drag-and-drop the crash file to the left panel. The file must end with a .crash extension, otherwise the drag fails. Switch to the All Logs tab. Select the added crash file. The file should automatically symbolicate, otherwise use the right-click context menu item Re-Symbolicate Log.
Xcode 11.2.1,2019 年 12 月
苹果会给你txt格式的崩溃日志,这是无符号的
**
连接设备后
**
下载“。txt”文件,将扩展名改为“。crash” 在Xcode的窗口选项卡中打开设备和模拟器 选择设备,选择设备日志 拖放.crash文件到设备日志窗口
我们可以在那里看到象征性的事故日志
请参阅有关符号化崩溃日志的更多详细信息的链接
我努力有崩溃报告符号化通过atos,但我不愿意,因为这个过程似乎很麻烦,但我发现崩溃报告在Xcode->窗口->组织者->崩溃(在左侧菜单)Xcode会自动下载崩溃日志,并将自动符号化,从那里你可以很容易地找到崩溃的原因。
推荐文章
- 在UITableView中检测哪个UIButton被按下了
- 为iOS模拟器构建,但链接框架'****.framework'是为iOS构建的
- iOS更新后保留旧的启动屏幕和应用程序图标
- 如何象征崩溃日志Xcode?
- 我如何得到一个plist作为一个字典在Swift?
- Xcode - ld:没有为- lpods找到库
- 自动调整掩码大小编程vs接口生成器/ xib / nib
- 我如何输入RGB值到接口生成器?
- NSUserDefaults -如何判断一个键是否存在
- Xcode UI测试用例中的延迟/等待
- 裁剪一个UIImage
- 在Xcode单元测试中使用@可测试时“没有这样的模块”
- 这个应用程序是否使用广告标识符(IDFA)?—AdMob 6.8.0
- iOS 7: UITableView显示在状态栏下
- 如何产生类似ios7模糊视图的效果?