iPhone模拟器生成的崩溃日志?

发布于 2024-08-13 18:55:12 字数 81 浏览 3 评论 0原文

iPhone Simulator 是否有生成崩溃日志?

模拟器崩溃了很多,但没有在控制台中留下任何痕迹......崩溃日志会很有用。

Are there any crash logs generated by iPhone Simulator?

the Simulator crashes a lot but not leaving any traces in Console... the crash log will be useful.

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

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

发布评论

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

评论(7

勿挽旧人 2024-08-20 18:55:12

控制台将显示模拟器中运行的应用程序的 NSLog() 输出。崩溃日志保存到文件中。

我在我的主目录下找到了一些文件,

~/Library/Logs/DiagnosticReports/

它们的文件扩展名为 .crash

我还没有弄清楚如何让它们生成,即使调试器获取了 EXC_BAD_ACCESS< /代码> 信号。


更新

目前,(OSX 10.11.6),~/Library/Logs/DiagnosticReports 中的 .crash 日志是模拟器本身崩溃应用程序崩溃的日志(但模拟器设备仍然运行良好)位于:

~/库/日志/CoreSimulator

每次崩溃时,都会有一个具有唯一 ID 的子文件夹。按日期排序,以便您最近的崩溃是第一个子文件夹。在其中,首先查看 stderr.logsystem.log

另外,直接在 CoreSimulator 下查看 CoreSimulator.logSimulator.log

The console will show the NSLog() output from an app running in the simulator. The crash logs are saved to file.

I have found some in my home directory under

~/Library/Logs/DiagnosticReports/

They have a file extension of .crash

Something I haven't yet figured out is how to get them to generate even if the debugger grabs the EXC_BAD_ACCESS signal.


Update

Currently, (OSX 10.11.6), the .crash logs in ~/Library/Logs/DiagnosticReports, are when the emulator itself crashes. Logs for an app crashing (but the emulator device is still running fine), are in:

~/Library/Logs/CoreSimulator

Per crash, there is a sub-folder with a unique id. Sort by date, so that your recent crash is the first sub-folder. Inside that, start by looking at stderr.log and system.log.

Also directly under CoreSimulator, see CoreSimulator.log and Simulator.log.

聽兲甴掵 2024-08-20 18:55:12

我非常确定您可以在“实用程序”中的 OS X 控制台应用程序中看到这一点。如果我错了,请务必投票给我,这样我就会删除它。


更新:

具体来说(从 OSX 10.11.6 开始),

当应用程序在模拟器上崩溃时,会向以下位置添加一个子文件夹(具有唯一的 id):

~/库/日志/CoreSimulator

在其中,首先检查 stderr.logsystem.log

当模拟器本身崩溃时,子文件夹将添加到:

~/库/日志/诊断报告

不要将此路径与

/库/日志

(开始时缺少 ~),其中包含有关您的 mac 的不同报告。

I am pretty sure that you can see this in the OS X Console app located in Utilities. If I'm wrong though, be sure to vote me the heck down so I delete this.


UPDATE:

Specifically (as of OSX 10.11.6),

When an app crashes on emulator, a subfolder (with a unique id) is added to:

~/Library/Logs/CoreSimulator

Within that, start by examining stderr.log and system.log.

When the emulator itself crashes, a subfolder is added to:

~/Library/Logs/DiagnosticReports

Don't confuse this path with

/Library/Logs

(lacking ~ at start), which has different reports about your mac.

雨后咖啡店 2024-08-20 18:55:12

这是在特殊情况下对我有用的东西......我的应用程序在终止时因 SIGKILL 崩溃。我会在 main.m 中看到异常几秒钟,然后应用程序将完成终止 - 因此,没有机会获得回溯。

我对“模拟器在哪里存储崩溃日志”进行了大量搜索,但从未找到答案。然而,以下技巧非常方便,我能够即时获取崩溃日志:

基本上,打开 /Applications/Utilities/CrashReporterPrefs.app 并将设置更改为“Developer”。这将导致 CrashReporter 在您的应用程序崩溃后显示带有崩溃日志的弹出窗口。

我在 Apple 文档的“查看 iOS 模拟器控制台和崩溃日志”部分中找到了这一点:
http://developer.apple。 com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/125-Using_iOS_Simulator/ios_simulator_application.html

Here’s something that worked for me in a special case... My app was crashing with SIGKILL as it terminated. I would see the exception in main.m for a few seconds, and then the app would finish terminating – thus, no chance to get the back trace.

I did a lot of searching on “where does simulator store its crash logs” and never managed to find an answer. However, the following trick came in quite handy and I was able to grab the crash log on the fly:

Basically, open /Applications/Utilities/CrashReporterPrefs.app and change the setting to “Developer”. This will cause CrashReporter to display a popup with the crash log after your app crashes.

I found this in the “Viewing iOS Simulator Console and Crash Logs” section in this doc from Apple:
http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/125-Using_iOS_Simulator/ios_simulator_application.html

风苍溪 2024-08-20 18:55:12

崩溃崩溃日志将出现在 ~/Library/Logs/CrashReporter 下。

  • 如果iPhone模拟器程序崩溃(不是模拟器中运行的iPhone应用程序崩溃),那么就会有一个iPhoneSimulator的条目。
  • 如果模拟器中的 iPhone 应用程序崩溃,崩溃日志中将显示该应用程序的显示名称。

当 Xcode 从连接的设备获取崩溃日志时,它将它们存储在 ~/Library/Logs/CrashReporter/MobileDevice 的子文件夹中

The crash crash logs will appear under ~/Library/Logs/CrashReporter.

  • If the iPhone simulator program crashes (not the iPhone app running within the simulator), then there will be an entry for iPhoneSimulator.
  • If the iPhone App within the simulator crashes, the crash log will appear with the display name of the app.

When Xcode gets crash logs from a connected device, it stores them in sub-folders of ~/Library/Logs/CrashReporter/MobileDevice

无所的.畏惧 2024-08-20 18:55:12

这要可靠得多。只需几个步骤,我就可以找到源代码行号&方法名称:

  1. cd 到具有 .app 和 .app 的目录.dSYM 文件
  2. 运行 /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin MyApp.app/MyApp
  3. set print asm-demangle on
  4. set print symbol-filename on
  5. p/a 0× 00015c64->通过在“控制台”应用程序中打开崩溃日志或双击 .crash 文件获得的地址。

This is much more reliable. In only a few steps I was able to find the source line number & method name:

  1. cd to the dir having the .app & .dSYM files
  2. run /Developer/Platforms/iPhoneOS.platform/Developer/usr/libexec/gdb/gdb-arm-apple-darwin MyApp.app/MyApp
  3. set print asm-demangle on
  4. set print symbol-filename on
  5. p/a 0×00015c64 -> address got by opening the crash log in “Console” app or just double clicking the the .crash file.
短叹 2024-08-20 18:55:12

对我来说,这是我添加到调试器监视窗口中的表达式。当遇到断点时,错误的表达式会导致 XCode 出现段错误。

For me, it was an expression that I had added to the debugger watch window. When a breakpoint was getting hit, the bad expression was causing XCode to segfault.

风吹雪碎 2024-08-20 18:55:12

您可能还想看看这个相关的答案:https://stackoverflow.com/a/14984297/679240

上述答案均不适用于“Big Sur”操作系统版本。查找日志的唯一方法是通过“控制台”应用程序(应用程序/实用程序/控制台)

You may also want to take a look at this related answer: https://stackoverflow.com/a/14984297/679240

None of the answers above worked on the "Big Sur" OS version. The only way to find the log was through the "Console" app (Application/Utilities/Console)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文