{"id":13610117,"url":"https://github.com/microsoft/plcrashreporter","last_synced_at":"2025-11-12T16:00:38.819Z","repository":{"id":9639158,"uuid":"11571442","full_name":"microsoft/plcrashreporter","owner":"microsoft","description":"Reliable, open-source crash reporting for iOS, macOS and tvOS","archived":false,"fork":false,"pushed_at":"2025-02-24T11:58:33.000Z","size":23811,"stargazers_count":2977,"open_issues_count":3,"forks_count":547,"subscribers_count":93,"default_branch":"master","last_synced_at":"2025-05-07T15:56:39.202Z","etag":null,"topics":["crash-reporting","ios","macos"],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fazland/FazlandElasticaBundle","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-07-22T02:38:00.000Z","updated_at":"2025-05-07T14:30:55.000Z","dependencies_parsed_at":"2023-02-13T20:01:55.243Z","dependency_job_id":"3e6680d8-5a32-41b8-bf79-227fb3c346ec","html_url":"https://github.com/microsoft/plcrashreporter","commit_stats":{"total_commits":1993,"total_committers":57,"mean_commits":34.96491228070175,"dds":0.6954340190667336,"last_synced_commit":"2e8dc9e58f49153d41310a1519bf57a86bc168ab"},"previous_names":["plausiblelabs/plcrashreporter"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fplcrashreporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fplcrashreporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fplcrashreporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fplcrashreporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/plcrashreporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000854,"owners_count":21997442,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crash-reporting","ios","macos"],"created_at":"2024-08-01T19:01:41.394Z","updated_at":"2025-11-12T16:00:33.797Z","avatar_url":"https://github.com/microsoft.png","language":"Objective-C","readme":"[![CocoaPods](https://img.shields.io/cocoapods/v/PLCrashReporter.svg)](https://cocoapods.org/pods/PLCrashReporter)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://swift.org/package-manager)\n\n# PLCrashReporter\n\nPLCrashReporter is a reliable open source library that provides an in-process live crash reporting framework for use on iOS, macOS and tvOS. The library detects crashes and generates reports to help your investigation and troubleshooting with the information of application, system, process, thread, etc. as well as stack traces.\n\nThe easiest way to use PLCrashReporter is by using [AppCenter](https://appcenter.ms). However, if you want to use PLCrashReporter directly, grab the latest release at [releases page](https://github.com/microsoft/plcrashreporter/releases).\n\n## Features\n\n- Uses only supported and public APIs/ABIs for crash reporting.\n- The most accurate stack unwinding available, using DWARF and Apple Compact Unwind frame data.\n- First released in 2008, and used in hundreds of thousands of apps. PLCrashReporter has seen a tremendous amount of user testing.\n- Does not interfere with debugging in lldb/gdb\n- Backtraces for all active threads are provided.\n- Provides full register state for the crashed thread.\n\n## Prerequisites\n\n- Xcode 11 or above.\n- Minimum supported platforms: iOS 12, macOS 11.5, tvOS 12, Mac Catalyst 13.0.\n\n## Decoding Crash Reports\n\nCrash reports are output as protobuf-encoded messages, and may be decoded using the CrashReporter library or any [Google Protocol Buffers](https://developers.google.com/protocol-buffers/) decoder.\n\nIn addition to the in-library decoding support, you may use the included `plcrashutil` binary to convert crash reports to apple's standard iPhone text format:\n\n```ruby\nplcrashutil convert --format=iphone example_report.plcrash\n```\n\nYou can use `atos` command-line tool to symbolicate the output. For more information about this tool, see [Adding Identifiable Symbol Names to a Crash Report](https://developer.apple.com/documentation/Xcode/adding-identifiable-symbol-names-to-a-crash-report).\nFuture library releases may include built-in re-usable formatters, for outputting alternative formats directly from the phone.\n\n## Adding PLCrashReporter to your project\n\nPLCrashReporter can be added to your app via [CocoaPods](https://guides.cocoapods.org/using/using-cocoapods.html), [Carthage](https://github.com/Carthage/Carthage#quick-start), [Swift Package Manager](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app), or by manually adding the binaries to your project.\n\n### Integration via Cocoapods\n\n1. Add the following line to your `Podfile`:\n    ```ruby\n    pod 'PLCrashReporter'\n    ```\n1. Run `pod install` to install your newly defined pod and open the project's `.xcworkspace`.\n\n### Integration via Swift Package Manager\n\n1. From the Xcode menu, click **File** \u003e **Swift Packages** \u003e **Add Package Dependency**.\n1. In the dialog that appears, enter the repository URL: https://github.com/microsoft/plcrashreporter.git.\n1. In Version, select **Up to Next Major** and take the default option.\n\n### Integration via Carthage\n\n1. Add the following line to your `Cartfile`:\n    ```ruby\n    github \"microsoft/plcrashreporter\"\n    ```\n1. Run `carthage update --use-xcframeworks` to fetch dependencies.\n2. In Xcode, open your application target's **General** settings tab.  Drag and drop **CrashReporter.xcframework** from the **Carthage/Build** folder into the `Frameworks, Libraries and Embedded Content` section.  For iOS and tvOS, set `Embed` to `Do not embed`.  For macoS, set `Embed` to `Embed and Sign`.\n\n\u003e **NOTE:**\n\u003e Carthage integration doesn't build the dependency correctly in Xcode 12 with flag \"--no-use-binaries\" or from a specific branch. To make it work, refer to [this instruction](https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md).\n\n### Integration by copying the binaries into your project\n\n1. Download the [PLCrashReporter](https://github.com/Microsoft/plcrashreporter/releases) frameworks provided as a zip file.\n2. Unzip the file and you'll see a folder called **PLCrashReporter** that contains subfolders for all supported platforms.\n3. Add PLCrashReporter to the project in Xcode:\n   * Make sure the Project Navigator is visible (⌘+1).\n   * Now drag \u0026 drop **PLCrashReporter.framework** (or **PLCrashReporter.xcframework**) from the Finder into Xcode's Project Navigator.\n   * A dialog will appear, make sure your app target is checked and click **Finish**.\n    \u003e **NOTE:**\n    \u003e PLCrashReporter xcframework contains static binaries for iOS and tvOS, and dynamic binaries for macOS. When adding the framework to your project make sure that in `Frameworks, Libraries and Embedded Content` section `Embed` is selected to `Do not embed` for iOS and tvOS and `Embed and Sign` for macOS. `PLCrashReporter-Static-{version}.zip` is an exception - it contains static frameworks for all platforms.\n\n## Example\n\nThe following example shows a way how to initialize crash reporter. Please note that enabling in-process crash reporting will conflict with any attached debuggers so make sure the **debugger isn't attached** when you crash the app.\n\n### Objective-c\n\n```objc\n@import CrashReporter;\n\n...\n\n// Uncomment and implement isDebuggerAttached to safely run this code with a debugger.\n// See: https://github.com/microsoft/plcrashreporter/blob/2dd862ce049e6f43feb355308dfc710f3af54c4d/Source/Crash%20Demo/main.m#L96\n// if (![self isDebuggerAttached]) {\n\n// It is strongly recommended that local symbolication only be enabled for non-release builds.\n// Use PLCrashReporterSymbolicationStrategyNone for release versions.\nPLCrashReporterConfig *config = [[PLCrashReporterConfig alloc] initWithSignalHandlerType: PLCrashReporterSignalHandlerTypeMach\n                                                                   symbolicationStrategy: PLCrashReporterSymbolicationStrategyAll];\nPLCrashReporter *crashReporter = [[PLCrashReporter alloc] initWithConfiguration: config];\n\n// Enable the Crash Reporter.\nNSError *error;\nif (![crashReporter enableCrashReporterAndReturnError: \u0026error]) {\n    NSLog(@\"Warning: Could not enable crash reporter: %@\", error);\n}\n// }\n```\n\nChecking collected crash report can be done in the following way:\n\n```objc\nif ([crashReporter hasPendingCrashReport]) {\n    NSError *error;\n\n    // Try loading the crash report.\n    NSData *data = [crashReporter loadPendingCrashReportDataAndReturnError: \u0026error];\n    if (data == nil) {\n        NSLog(@\"Failed to load crash report data: %@\", error);\n        return;\n    }\n\n    // Retrieving crash reporter data.\n    PLCrashReport *report = [[PLCrashReport alloc] initWithData: data error: \u0026error];\n    if (report == nil) {\n        NSLog(@\"Failed to parse crash report: %@\", error);\n        return;\n    }\n\n    // We could send the report from here, but we'll just print out some debugging info instead.\n    NSString *text = [PLCrashReportTextFormatter stringValueForCrashReport: report withTextFormat: PLCrashReportTextFormatiOS];\n    NSLog(@\"%@\", text);\n\n    // Purge the report.\n    [crashReporter purgePendingCrashReport];\n}\n```\n\n### Swift\n\n```swift \nimport CrashReporter\n\n...\n// Uncomment and implement isDebuggerAttached to safely run this code with a debugger.\n// See: https://github.com/microsoft/plcrashreporter/blob/2dd862ce049e6f43feb355308dfc710f3af54c4d/Source/Crash%20Demo/main.m#L96\n// if (!isDebuggerAttached()) {\n\n  // It is strongly recommended that local symbolication only be enabled for non-release builds.\n  // Use [] for release versions.\n  let config = PLCrashReporterConfig(signalHandlerType: .mach, symbolicationStrategy: .all)\n  guard let crashReporter = PLCrashReporter(configuration: config) else {\n    print(\"Could not create an instance of PLCrashReporter\")\n    return\n  }\n\n  // Enable the Crash Reporter.\n  do {\n    try crashReporter.enableAndReturnError()\n  } catch let error {\n    print(\"Warning: Could not enable crash reporter: \\(error)\")\n  }\n// }\n```\n\nChecking collected crash report can be done in the following way:\n\n```swift\n  // Try loading the crash report.\n  if crashReporter.hasPendingCrashReport() {\n    do {\n      let data = try crashReporter.loadPendingCrashReportDataAndReturnError()\n\n      // Retrieving crash reporter data.\n      let report = try PLCrashReport(data: data)\n\n      // We could send the report from here, but we'll just print out some debugging info instead.\n      if let text = PLCrashReportTextFormatter.stringValue(for: report, with: PLCrashReportTextFormatiOS) { \n        print(text)\n      } else {\n        print(\"CrashReporter: can't convert report to text\")\n      }\n    } catch let error {\n      print(\"CrashReporter failed to load and parse with error: \\(error)\")\n    }\n  }\n\n  // Purge the report.\n  crashReporter.purgePendingCrashReport()\n```\n\n## Building\n\n### Prerequisites\n\n- A Mac running macOS compliant with Xcode requirements.\n- Xcode 11 or above.\n\nAlso, next optional tools are used to build additional resources:\n\n- Doxygen to generate the documentation. See [the official Doxygen repository](https://github.com/doxygen/doxygen) for more information or use [Homebrew](https://brew.sh) to install it.\n- GraphViz to generate the documentation. See [the official GraphViz website](https://www.graphviz.org/download/) for more information or use [Homebrew](https://brew.sh) to install it.\n- `protobuf-c` to convert Protocol Buffer `.proto` files to C descriptor code. See [the official protobuf-c repository](https://github.com/protobuf-c/protobuf-c) for more information or use [Homebrew](https://brew.sh) to install it.\n\n### Proto files modification\nIf you have modified any files with the .proto extension (such as `Tests/PLCrashLogWriterEncodingTests.proto` or `Source/PLCrashReport.proto`), then before building the project, you need to generate the source files using `protobuf-c`. To do this, you can run the following script:\n```bash\n./Dependencies/protobuf-c/generate-pb-c.sh\n```\n\n### Building\n\n- Open a new window for your Terminal.\n- Go to PLCrashReporter's root folder and run\n\n    ```bash\n    xcodebuild -configuration Release -target 'CrashReporter'\n    ```\n\n    to create binaries for all platforms.\n\n## Updating protobuf-c\n\nTo update the `protobuf-c` dependency:\n\n1. Download the latest `protobuf-c.h` and `protobuf-c.c` files from the [protobuf-c GitHub repository](https://github.com/protobuf-c/protobuf-c).\n2. Replace the existing files in `Dependencies/protobuf-c` with the downloaded ones.\n3. Run the script:\n```bash\n./Dependencies/protobuf-c/generate-pb-c.sh\n```\n\n## Contributing\n\nWe are looking forward to your contributions via pull requests.\n\nTo contribute to PLCrashReporter, you need the tools mentioned above to build PLCrashReporter for all architectures and `protobuf-c` to convert Protocol Buffer `.proto` files to C descriptor code.\n\n### Code of Conduct\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n","funding_links":[],"categories":["Objective-C","HarmonyOS"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fplcrashreporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fplcrashreporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fplcrashreporter/lists"}