Back to Skills

sentry-cocoa-sdk

Full Sentry SDK setup for Apple platforms (iOS, macOS, tvOS, watchOS, visionOS). Use when asked to "add Sentry to iOS", "add Sentry to Swift", "install sentry-cocoa", or configure error monitoring, tracing, profiling, session replay, logging, or metrics for Apple applications. Supports SwiftUI and UIKit.

228stars30forksUpdated 6/29/2026

Security Assessment

Low Risk(80/100)

Detected risks:

Sensitive File Access([references/error-monitoring.md] .env, [references/logging.md] .env, [SKILL.md] .env)
Security Score80/100

About sentry-cocoa-sdk

A full Sentry SDK setup wizard for Apple platforms — iOS, macOS, tvOS, watchOS, and visionOS — covering both SwiftUI and UIKit. It applies when adding Sentry to an iOS or Swift app, installing sentry-cocoa, or configuring error monitoring, tracing, profiling, session replay, logging, or metrics. The doc reflects sentry-cocoa 9.15.0 at time of writing and repeatedly advises verifying against the official Apple platform docs before implementing, since SDK versions and APIs change.

The skill runs as an opinionated three-plus-phase workflow. Phase 1 (Detect) runs grep and ls commands to find an existing Sentry dependency, determine the UI framework (SwiftUI @main App struct versus UIKit AppDelegate), detect platforms and deployment targets, spot an existing logging library, and check for a companion backend. Phase 2 (Recommend) leads with a concrete proposal rather than open questions: Error Monitoring and Tracing always, Profiling for production iOS/macOS apps, with Session Replay, Logging, Metrics, and User Feedback as optional enhancements. A recommendation-logic table notes platform constraints, and it flags that Crons and AI Monitoring are not available for Cocoa.

Phase 3 (Guide) covers installation through four options: the Sentry Wizard (recommended, but the user must run it themselves because it opens a browser and needs interactive input), Swift Package Manager, CocoaPods (deprecated, with publishing planned to stop at end of June 2026), and SentryObjC for pure Objective-C/C++ projects that cannot enable Clang modules. It details SPM product selection — choose exactly one of Sentry, Sentry-Dynamic, SentrySwiftUI, Sentry-WithoutUIKitOrAppKit, or SentrySPM with the NoUIFramework trait — and documents Swift 6.1+ trait-based opt-out of UIKit/AppKit, Xcode 26.4+ trait visibility, and known issues such as the Xcode 14+ rsync.samba sandbox error fixed by disabling User Script Sandbox. Model invocation is disabled, and the skill sits under the Sentry SDK Setup tree.

FAQ

Which Apple platforms and UI frameworks does this skill support?

It supports iOS, macOS, tvOS, watchOS, and visionOS, with both SwiftUI and UIKit. Phase 1 detection distinguishes a SwiftUI @main App struct from a UIKit AppDelegate to choose the init pattern.

Which Sentry features are recommended versus unavailable for Cocoa?

Error Monitoring and Tracing are recommended always, Profiling for production iOS/macOS apps, with Session Replay, Logging, Metrics, and User Feedback optional. Crons and AI Monitoring are not available for Cocoa (backend or JS/Python only).

How do I install the SDK?

Options include the Sentry Wizard (recommended, run by the user since it needs a browser login), Swift Package Manager, CocoaPods (deprecated), and SentryObjC for pure Objective-C/C++ projects that cannot enable Clang modules.

Which SPM product should I select?

Choose exactly one per target. Sentry is recommended (static framework, includes SwiftUI APIs in SDK 9.4.1+); other options are Sentry-Dynamic, the deprecated SentrySwiftUI, Sentry-WithoutUIKitOrAppKit, and SentrySPM with the NoUIFramework trait for headless targets.

What known build issue does the doc call out for Xcode?

On Xcode 14+, a Sandbox rsync.samba error can occur; the fix is Target Settings then setting Enable User Script Sandbox to NO.

All Files

8 files
references/error-monitoring.md12.3 KB
View
references/metrics.md3.8 KB
View
references/session-replay.md9.6 KB
View
references/user-feedback.md10.1 KB
View
references/logging.md7.1 KB
View
references/profiling.md7.8 KB
View
references/tracing.md16.9 KB
View
SKILL.md21.0 KB
View

Install sentry-cocoa-sdk

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill