watchOS
Installation
The minimum version for watchOS is 2.0. Our SDK has limited symbolication support and no crash handling for watchOS.
We recommend installing the SDK with CocoaPods. To integrate Sentry into your Xcode project, specify it in your Podfile:
platform :watchos, '2.0'
use_frameworks! # This is important
target 'YourApp' do
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '6.0.12'
end
Afterwards run pod install
.
For other installation methods, please see our documentation.
Configuration
Initialize the SDK as soon as possible in your application lifecycle, such as in your AppDelegate application:didFinishLaunchingWithOptions
method:
import Sentry // Make sure you import Sentry
// ....
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
SentrySDK.start { options in
options.dsn = "https://examplePublicKey@o0.ingest.sentry.io/0"
options.debug = true // Enabled debug when first installing is always helpful
}
return true
}
Debug Symbols
Before capturing crashes, you need to provide debug information to Sentry. Debug information is provided by uploading dSYM files using one of two methods, dependent on your setup:
Verify
To validate that the SDK is correctly set up and connected to your Sentry project, capture a test message:
import Sentry
SentrySDK.capture(message: "My first test message")
If everything is working correctly, this message should appear within seconds in your Sentry project.
Crash Handling
Our SDK hooks into all signal and exception handlers, except for MacOS. If you are using MacOS, please see the additional step provided in Advanced Usage To try it out, the SDK provides a test crash function:
import Sentry
SentrySDK.crash()
If you crash with a debugger attached, nothing will happen.
Crashes are submitted only upon re-launch of the application. To view the crash in Sentry, close your app and re-launch it.
- Package:
- cocoapods:sentry-cocoa
- Version:
- 6.0.12
- Repository:
- https://github.com/getsentry/sentry-cocoa