In XCode:
Select th sentry-cocoa root folder to open the app profile:
-
Set a
SENTRY_AUTH_TOKEN
in 'Run Script' build phase. -
Put your DSN key in
sentry-cocoa/AppDelegate.swift
-
sentry-cli must be installed at /usr/local/bin
-
XCode Edit Schemes > 'Run' action for your scheme > Info tab > uncheck 'Debug executable' box.
This ensures your app doesn't run in debugging mode, in which case unhandled exceptions won't send to Sentry. -
Click the Run/play button targeting iPhone 11
-
In Simulator, Launch the sentry-cocoa app
-
Press a button to generate an Error
Check out a new branch so you can open a PR.
- Xcode -> Podfile, increment the sdk version.
pod update
- Click 'Play' button
The demo app enriches every event with: Custom context, breadcrumbs, tags, user IP, extra data.
- From the Simulator explicitly send an event to Sentry by clicking
- Handled Exception
- Capture Message
- For Native crashes click:
- Crash Application
- UnHandled Exception
- Release:
- Note that the cocoa-sdk automatically creates a Release by using the build version + dist as described in the Android SDK Release Version Format
- The SDK then automatically tags every event with that release version id (i.e. there is no need to explicitly set the release version ID, unless you're explicitly setting a custom release name)
-
Run Scripts:
Upload the Debug Symbols to the target project and associate the commits to the release object.
https://docs.sentry.io/clients/cocoa/
If you still enter debugging mode by accident, then click 'Stop' which will detach the debugger, then re-launch the app from the touch screen. Do not click 'Play' again or else the debugger will re-attach.
CrashApplication button makes "EXC_BAD_INSTRUCTION: Fatal error > procpath"
UnhandledException button makes "EXC_BAD_ACCESS:causeCrash: > crash > Attempted to derefer"
Crashes and unhandled exceptions will have stack traces for several threads. Messages and Handled exceptions will have stack trace for top-level thread.