https://github.com/backtrace-labs/backtrace-crashpad-cocoapod
A Cocoapods integration of Crashpad.
https://github.com/backtrace-labs/backtrace-crashpad-cocoapod
crashpad
Last synced: 2 months ago
JSON representation
A Cocoapods integration of Crashpad.
- Host: GitHub
- URL: https://github.com/backtrace-labs/backtrace-crashpad-cocoapod
- Owner: backtrace-labs
- License: apache-2.0
- Created: 2019-07-10T22:55:22.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-02T18:10:30.000Z (over 5 years ago)
- Last Synced: 2025-03-09T10:05:20.246Z (3 months ago)
- Topics: crashpad
- Language: C++
- Homepage: https://github.com/backtrace-labs/crashpad
- Size: 2.18 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backtrace-Crashpad
[Backtrace](http://backtrace.io/)'s binary package for [Crashpad](https://github.com/backtrace-labs/crashpad) with modifications provided by [Backtrace](https://backtrace.io).## Crashpad
[Crashpad](https://crashpad.chromium.org/) is a crash-reporting system.
### Documentation
* [Crashpad interface documentation](https://crashpad.chromium.org/doxygen/)### Source Code
Crashpad’s source code is hosted in a Git repository at
https://chromium.googlesource.com/crashpad/crashpad.### Other Links
* Bugs can be reported at the [Crashpad issue
tracker](https://crashpad.chromium.org/bug/).
* The [Crashpad bots](https://ci.chromium.org/p/crashpad/g/main/console)
perform automated builds and tests.
* [crashpad-dev](https://groups.google.com/a/chromium.org/group/crashpad-dev)
is the Crashpad developers’ mailing list.To use [CocoaPods](https://cocoapods.org) just add this to your Podfile:
```
pod 'Backtrace-Crashpad'
```**Note:** It is required to specify `use_frameworks!` in your Podfile.
## Sample usage
```objc++
#include
#include
#include
#include
#includevoid startCrashpad() {
std::map annotations;
annotations["format"] = "minidump";
annotations["token"] = "";
std::vector arguments;
CrashpadClient client;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *docsPath = [paths objectAtIndex:0];
std::unique_ptr database = CrashReportDatabase::Initialize(base::FilePath{[[docsPath stringByAppendingString:@"/crashpad_db"] cStringUsingEncoding: NSUTF8StringEncoding]});
database->GetSettings()->SetUploadsEnabled(true);
NSString *crashpadHandlerPath = [[NSBundle mainBundle] pathForResource: @"crashpad_handler" ofType: @""];
arguments.push_back("--no-rate-limit");
client.StartHandler(base::FilePath{[crashpadHandlerPath cStringUsingEncoding: NSUTF8StringEncoding]},
base::FilePath{[[docsPath stringByAppendingString:@"/crashpad_db"] cStringUsingEncoding: NSUTF8StringEncoding]},
base::FilePath{[[docsPath stringByAppendingString:@"/crashpad_db"] cStringUsingEncoding: NSUTF8StringEncoding]},
"https://team.sp.backtrace.io:6098/post",
annotations,
arguments,
true,
true);// Crash the app
DoTheImpossible();
}
```## Known limitations
This package currently does not support distributing macOS app through the Mac App Store, because [App Sandbox capability](https://developer.apple.com/documentation/security/app_sandbox_entitlements) needs to be disabled.