Analyzing Crash Reports

After you distribute your app for testing by using TestFlight or after you make it available on the store, routinely download and analyze crash reports. When an app crashes, the system creates a crash log that describes the conditions under which the app terminated, in most cases including a complete stack trace for each executing thread. Apple provides a crash report service that collects and aggregates user crash logs. Crash reports are available for apps, WatchKit extensions, and other app extensions.

Alternatively, view crash logs directly on devices or import crash reports, as described in Viewing and Importing Crashes in the Devices Window. For example, if you distribute your app outside of the store, you can solicit crash reports directly from users and import them into Xcode.

About the Crash Report Service

Apple provides a service that allows you to download crash reports for the most recent app versions and builds that you distribute through the store. The service collects and groups similar crash logs into crash reports. Each build of an app may have multiple crash reports and each crash report may contain multiple crash logs. However, crash logs are not sent to Apple unless the user agrees to share crash data with app developers. TestFlight users automatically agree to share crash data. The service does the following to generate crash reports:

  • Collects crash logs from apps and app extensions running on user devices

  • Symbolicates the crash logs (replaces memory addresses with human-readable names)

  • Compares stack traces to identify and group similar crash logs into crash reports

  • Removes all personal user data from crash logs

  • Provides the total number of unique devices where the crash occurred

  • Provides a sample set of crash logs for each crash report

  • Updates crash reports daily

Xcode displays information about crash reports in the Crashes organizer:

Before Viewing Crash Reports

Perform all these steps to fully enable the crash report service. If you previously uploaded an app with symbols to iTunes Connect and distributed it using TestFlight or the store, you may already see crash reports in the Crashes organizer. If you do not see crash reports in the the Crashes organizer, verify that you have performed these steps.

 

Step

In Xcode, enter an Apple ID in Accounts preferences that belongs to the Apple Developer Program, as described in Adding Your Apple ID Account in Xcode.

Set the version and build number, as described in Setting the Version Number and Build String. If you are distributing another build of your app, increment the build string.

Create a single app archive and upload it to iTunes Connect with symbols, as described in Uploading Your App to iTunes Connect. (Ensure that the “Include app symbols for your application…” box is checked before you click Upload.)

Do not delete archives that you upload to iTunes Connect.

In iTunes Connect, distribute the app to testers using TestFlight, as described in TestFlight Beta Testing (Optional), or submit the app for review, as described in Submitting the App to App Review.

Users who download your app from the store need to agree to share crash data with app developers, as described in Sharing Crash Data with App Developers. (TestFlight users automatically agree to share crash data.)

In Xcode, to view crash reports, enter an Apple ID that is a team agent or admin, or an iTunes Connect user, as described in Adding Your Apple ID Account in Xcode.

In Xcode, to go from a stack frame in the Crashes organizer to the source code in debug navigator, open the Xcode project that you archived and uploaded to iTunes Connect.

Also, allow up to three days between when you first distribute your app and when crash reports appear in Xcode. To maintain a good user experience, crash data is sent from user devices to Apple when the user allows.

Viewing Crash Reports in the Crashes Organizer

The Crashes organizer displays crash reports for all the apps developed by all your teams.

To view crash reports

  1. In the organizer, click Crashes.

  2. In the left column, select an app or local archive from the list.

    The list of apps is obtained from iTunes Connect and includes information about every version and build you uploaded to iTunes Connect.

  3. At the top of the second column, choose a version and build from the pop-up menu.

    Xcode begins refreshing the crash reports for the version and build you select. Xcode downloads the top 25 crash reports—crash reports with the most number of occurrences on unique devices—that occurred during the past two weeks.

  4. In the second column, select a crash report.

    The title of the crash report defaults to the stack frame where the crash likely occurred. The number of unique device occurrences of the crash appears below the crash title. Crash reports for a WatchKit extension are denoted with a watch icon () and crash reports for other app extensions are denoted with a puzzle icon ().

  5. In the detail area, view the crash logs.

    The detail area displays the stack trace for each thread. The stack frame where the crash occurred is highlighted in orange.

  6. In the inspector, add information and view statistics about a crash report.

Viewing and Finding Crash Reports

In the crash report list, perform these actions:

  • To search for crash reports, enter a string in the search field at the bottom.

  • To view the crash logs of a crash report in the Finder, Control-click a crash report and choose Show in Finder.

In the detail area, perform these actions:

  • To view the previous or next crash log of a crash report, click the page arrows (< or >) in the footer, or click the page count (for example, 11 of 20) and choose a page from the pop-up menu.

  • To collapse or expand the crash log, click the filter icon () in the lower-left corner in the footer. Collapse the crash log to view only the stack frames in your app. Expand the crash log to view all the stack frames including framework and system stack frames.

Editing Information About Crash Reports

As you resolve issues, you can store information about crash reports locally.

In the crash report list, perform these actions:

  • To mark a crash report as resolved, select the circle next to the crash report or at the bottom of the inspector, and click “Mark as Resolved.”

  • To show or hide resolved crash reports, select the circle () in the footer next to the search field.

In the detail area, perform this action:

  • To change the name of a crash report, place the insertion point in the header and edit the text.

In the inspector, perform this action:

  • To add notes about a crash report, enter the notes in the Notes text field.

Opening the Source Code in the Debug Navigator

In the detail area, perform these actions:

  • To go to the source code for a stack frame, hover over the stack frame and click the arrow that appears to the right.

  • To go to the source code where the crash occurred, click the arrow that appears when you hover the pointer over the stack frame that is highlighted.

In the inspector, perform this action:

  • To go to the source code for a stack frame, click “Open in Project.”

Xcode opens the associated project and displays the line of code in the debug navigator.

Viewing Statistics About Crash Reports

View the crash data over the past two weeks by device type, operating system, and date. To change the device type, choose Device Type from the pop-up menu. To change the operating system, choose Operating System from the pop-up menu.

Sharing Crash Data with App Developers

Apple can’t provide crash reports if users don’t share the crash data with app developers. If a user reports a crash and you don’t have a corresponding crash report, ask the user to share the crash data with app developers. Crash data is automatically sent to Apple for TestFlight apps but not apps the user downloads from the store.

Give these instruction to users. On all platforms, the crash data option is in the Diagnostics section of the Privacy settings.

To share crash data with iOS developers

  1. In Settings, tap Privacy.

  2. Scroll to the bottom and tap Diagnostics & Usage.

  3. If necessary, tap the Share With App Developer switch to enable it.

Similarly, ask Mac users to share their crash data with app developers.

To share crash data with Mac developers

  1. In System Preferences, click Security & Privacy.

  2. Click Privacy and in the left column, click Diagnostics & Usage.

  3. Select “Share crash data with app developers.”

    To enable the Privacy options, click the lock icon. In the dialog that appears, enter the credentials for a system account with admin privileges and click Unlock.

Apple TV users can also share their crash data.

To share crash data with tvOS developers

  1. In Settings, click General and click Privacy.

  2. Under Diagnostic Data, click “Share with App Developers.”

  3. In the dialog that appears, click “Send to Apple.”

Viewing and Importing Crashes in the Devices Window

In the Devices Window, you can view details about a crash log directly on a device or import crash reports you receive from other sources. If you have an archive containing the matching build and .dSYM files, Xcode automatically symbolicates crash reports. Xcode replaces the memory addresses in the crash log with human-readable function names and line numbers. Then you can view the stack trace for each execution thread in the Devices window.

For this reason, do not delete archives that you upload, export, and distribute to users. For example, if you distribute your app using an ad hoc provisioning profile or team provisioning profile (read Exporting Your App for Testing (iOS, tvOS, watchOS) and Exporting Your App for Testing (Mac)), retain the archive so you can import unsymbolicated crash reports you receive from testers.

You can also view crashes for apps distributed using TestFlight or the store. If you include bitcode when you upload your app, the store retains the .dSYM files and you must download them before you can view crashes in the Devices window. If you don’t include bitcode or distribute your app outside the store, your archive already contains the .dSYMfiles.

Note: If you upload your app with symbols, you can view crash reports in the Crashes organizer instead, described in Viewing Crash Reports in the Crashes Organizer.

If you include bitcode when you upload your app, download the associated .dSYM file first.

To download the dSYMs files

  1. In the Archives organizer, select the archive.

  2. Click the Download dSYMs button.

    Xcode inserts the .dSYM files in the selected archive.

    Important: Xcode uses the version and build numbers in the archive to request the .dSYM files. Therefore, always increment the build number, described in Setting the Version Number and Build String, before uploading your app.

To view crash logs on a device or import a crash report

  1. Choose Window > Devices.

  2. If necessary, connect your device to your Mac.

  3. Select the device under Devices, and click the View Device Logs button.

    A sheet appears displaying the crash logs on the device.

  4. To view a crash log, select it in the left column.

    View the crash log in the detail view on the right.

  5. To import a crash report, drag the crash report from the Finder to the left column of the sheet.

  6. Click Done.

Reproducing Crashes in Xcode

Make sure to test the exact same build that crashed. Save all the archives that you distribute for testing or upload to iTunes Connect. Verify that the archive in Xcode matches the crash report by comparing the build and version numbers. Follow these same steps to determine if you’re testing the same build that you submitted to the store.

For Mac apps, to reproduce a crash, use a guest account with a fresh install of the version of OS X that matches the crash report. Don’t attempt to recreate a crash using a developer or admin system account, because the problems you want to analyze may not occur.

Supported Crash Reports

Crash logs are collected from apps running on these operating system releases and viewable in these Xcode releases.

Crashes of target

Running OS

Available in

iOS app

iOS 8.2 and later

Xcode 6.3 and later

iOS app extension

iOS 8.3 and later

Xcode 7.0 and later

Mac app

OS X 10.10 and later

Xcode 7.0 and later

Mac app extension

OS X 10.11 and later

Xcode 7.1 and later

tvOS app

tvOS 9.0 and later

Xcode 7.2 and later

WatchKit extension

watchOS 2 app paired with iOS 9.1 app

Xcode 7.1 and later

Apple 官方网站链接:

https://developer.apple.com/library/content/documentation/IDEs/Conceptual/AppDistributionGuide/AnalyzingCrashReports/AnalyzingCrashReports.html#//apple_ref/doc/uid/TP40012582-CH21-SW3

Xcode 9 Analyzing Crash Reports的更多相关文章

  1. Understanding and Analyzing Application Crash Reports

    Introduction When an application crashes, a crash report is created and stored on the device. Crash ...

  2. Symbolicating Crash Reports With atos

    地址:0x1000e4000 + 49116 = 0x00000001000effdc都是运行时地址: 0x1000e4000:基址偏移后的地址: 0x100000000: 共知基址:各个环境都知道, ...

  3. App Distribution Guide--(三)---Configuring Your Xcode Project for Distribution

    Configuring Your Xcode Project for Distribution You can edit your project settings anytime, but some ...

  4. TN2151:崩溃报告

    understanding and analyzing ios application crashreports 这个TN涉及了与崩溃相关的 内存耗尽信息,堆栈信息 以及 异常编号 等信息 内存耗尽 ...

  5. 如何看iOS崩溃日志

    重点:Triggered by Thread这句话后边的线程号,快速定位问题出现在那个线程,是否是你的锅:Triggered by Thread所指的线程表示导致异常.崩溃的线程 下边内容转自简书 简 ...

  6. App Distribution Guide (一)

    This guide contains everything you need to know to distribute an app through the App Store or Mac Ap ...

  7. 发布ios应用程序

    详见文档 AppDistributionGuide Submit and Release Your App 首先,需要登入itunes connect并且输入必要的信息更改app状态为 waiting ...

  8. [App Store Connect帮助]六、测试 Beta 版本(4.2) 管理 Beta 版构建版本:查看构建版本状态和指标

    必要职能:“帐户持有人”职能.“管理”职能.“App 管理”职能.“开发者”职能或“营销”职能.请参见职能权限. 在首页上,点按“我的 App”,选择您的 App,然后在工具栏中点按“TestFlig ...

  9. iOS: Crash文件解析(一)

    iOS Crash文件的解析(一) 开发程序的过程中不管我们已经如何小心,总是会在不经意间遇到程序闪退.脑补一下当你在一群人面前自信的拿着你的App做功能预演的时候,流畅的操作被无情地Crash打断. ...

随机推荐

  1. 2018.07.28 uoj#169. 【UR #11】元旦老人与数列(线段树)

    传送门 线段树好题. 维护区间加,区间取最大值,维护区间最小值,历史区间最小值. 同样先考虑不用维护历史区间最小值的情况,这个可以参考这道题的解法,维护区间最小和次小值可以解决前两个操作,然后使用历史 ...

  2. =delete(c++11)

    1.为什么要阻止类对象的拷贝? 1)有些类,不需要拷贝和赋值运算符,如:IO类,以避免多个拷贝对象写入或读取相同的IO缓冲 2.如何阻止? 1)不定义拷贝构造函数和拷贝赋值运算符时,好心的编译器也会及 ...

  3. 安装hue-3.11.0

    1) 配置HDFS HttpFS和WebHDFS 如果HDFS是HA方式部署的,则只能使用HttpFS,而不能用WebHDFS. 2) 安装依赖: apr-iconv-1.2.1 confuse-3. ...

  4. 玩转Nodejs的集群

    在Nodejs中使用集群还是不容易的.Javascript的单线程属性让nodejs下的应用很难使用现代机器的多核特性.比如下面的代码实现了一个http服务器的主干部分.这部分代码只会执行在一个线程上 ...

  5. 201709012工作日记--一台电脑创建两个Github账户上传代码

    1. 在一台主机上面使用多个GitHub账号 有时候,我们需要将个人账号和公司账号区分,这时候我们就会需要在一台电脑上使用2个不同的git账号. 2. 上传文件 http://blog.csdn.ne ...

  6. 整理iOS9适配中出现的坑

    一.NSAppTransportSecurity iOS9让所有的HTTP默认使用了HTTPS,原来的HTTP协议传输都改成TLS1.2协议进行传输.直接造成的情况就是App发请求的时候弹出网络无法连 ...

  7. MySQL性能调优与架构设计——第 18 章 高可用设计之 MySQL 监控

    第 18 章 高可用设计之 MySQL 监控 前言: 一个经过高可用可扩展设计的 MySQL 数据库集群,如果没有一个足够精细足够强大的监控系统,同样可能会让之前在高可用设计方面所做的努力功亏一篑.一 ...

  8. 20155323 2016-2017-2 《Java程序设计》第6周学习总结

    20155323 2016-2017-2 <Java程序设计>第6周学习总结 教材学习内容总结 串流:衔接数据的来源和目的地就是串流对象. I/O操作主要是指使用Java进行输入,输出操作 ...

  9. java web代码规范:

    每个类前要有注释,类前的注释格式是: /** *类是干什么的 *@author  编写该类的作者 */ 类中的每个方法前也要有注释: /** *该方法是干什么的 *@param 该方法中传入的参数 * ...

  10. java Map集合学习

    学习语法还是从例子着手: FileDao fileDao=new FileBeanDaoImpl(); FileBean fileBean=new FileBean(); listBean=fileD ...