Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问许可证需确认审计通过

sentry-ios-swift-setupSentry iOS Swift 设置

Agent Skill

sentry-ios-swift-setup 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

416

周安装

17

GitHub Stars

19

下载量

133
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sentry-ios-swift-setup(Sentry iOS Swift 设置)
来源仓库:https://github.com/getsentry/agent-skills
仓库路径:skills/sentry-ios-swift-setup
安装命令:
npx skills add https://github.com/getsentry/agent-skills --skill sentry-ios-swift-setup
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/getsentry/agent-skills --skill sentry-ios-swift-setup

简介

sentry-ios-swift-setup 用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合围绕仓库状态、代码变更或协作事项进行整理与分析。
  • 通过 GitHub 安装,支持 Codex、Claude 等平台调用。
  • 建议在使用前确认权限范围和维护状态,防范潜在风险。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Sentry iOS Swift Setup

Install and configure Sentry in iOS projects using Swift and SwiftUI.

Invoke This Skill When

  • User asks to "add Sentry to iOS" or "install Sentry" in a Swift app
  • User wants error monitoring, tracing, or session replay in iOS
  • User mentions "sentry-cocoa" or iOS crash reporting

Important: The configuration options and code samples below are examples. Always verify against docs.sentry.io before implementing, as APIs and defaults may have changed.

Requirements

  • iOS 15.0+, macOS 12.0+, tvOS 15.0+, watchOS 8.0+

Install

Swift Package Manager (Recommended)

  1. File > Add Package Dependencies
  2. Enter: https://github.com/getsentry/sentry-cocoa.git
  3. Select version rule: "Up to Next Major" from 9.5.0

SPM Products: Choose based on your needs:

ProductUse Case
SentryDefault (static linking)
Sentry-DynamicDynamic framework
SentrySwiftUISwiftUI view performance tracking
Sentry-WithoutUIKitOrAppKitApp extensions or CLI tools

CocoaPods

# Podfile
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa.git', :tag => '9.5.0'

Then run pod install.

Configure

SwiftUI App

import SwiftUI
import Sentry

@main
struct YourApp: App {
    init() {
        SentrySDK.start { options in
            options.dsn = "YOUR_SENTRY_DSN"
            options.debug = true

            // Tracing
            options.tracesSampleRate = 1.0

            // Profiling
            options.configureProfiling = {
                $0.sessionSampleRate = 1.0
                $0.lifecycle = .trace
            }

            // Session Replay
            options.sessionReplay.sessionSampleRate = 1.0
            options.sessionReplay.onErrorSampleRate = 1.0

            // Logs (SDK 9.0.0+; for 8.55.0-8.x use options.experimental.enableLogs)
            options.enableLogs = true

            // Error context
            options.attachScreenshot = true
            options.attachViewHierarchy = true
        }
    }

    var body: some Scene {
        WindowGroup { ContentView() }
    }
}

UIKit App

import UIKit
import Sentry

@main
class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication,
                     didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        SentrySDK.start { options in
            options.dsn = "YOUR_SENTRY_DSN"
            options.debug = true
            options.tracesSampleRate = 1.0
            options.enableLogs = true
        }
        return true
    }
}

Configuration Options

OptionDescriptionDefault
dsnSentry DSNRequired
tracesSampleRate% of transactions traced0
sessionReplay.sessionSampleRate% of sessions replayed0
sessionReplay.onErrorSampleRate% of error sessions replayed0
enableLogsSend logs to Sentryfalse
attachScreenshotAttach screenshot on errorfalse
attachViewHierarchyAttach view hierarchy on errorfalse

Auto-Instrumented Features

FeatureWhat's Captured
App LaunchesCold/warm start times
NetworkURLSession requests
UIUIViewController loads, user interactions
File I/ORead/write operations
Core DataFetch/save operations
FramesSlow and frozen frame detection

Logging

let logger = SentrySDK.logger

logger.info("User action", attributes: [
    "userId": "123",
    "action": "checkout"
])

// Log levels: trace, debug, info, warn, error, fatal

Session Replay

iOS 26+ / Xcode 26+ caveat: SDK 8.57.0+ automatically disables Session Replay on iOS 26.0+ when built with Xcode 26.0+ due to Apple's Liquid Glass rendering breaking masking reliability. Replay still works on iOS < 26 or Xcode < 26. To force-enable (use with caution): options.experimental.enableSessionReplayInUnreliableEnvironment = true.

Masking

// SwiftUI modifiers
Text("Safe content").sentryReplayUnmask()
Text(user.email).sentryReplayMask()

User Context

let user = User()
user.userId = "user_123"
user.email = "user@example.com"
SentrySDK.setUser(user)

// Clear on logout
SentrySDK.setUser(nil)

Verification

// Test error capture
SentrySDK.capture(message: "Test from iOS")

// Or trigger a test error
do {
    try someFailingFunction()
} catch {
    SentrySDK.capture(error: error)
}

Production Settings

SentrySDK.start { options in
    options.dsn = "YOUR_SENTRY_DSN"
    options.debug = false
    options.tracesSampleRate = 0.2  // 20%
    options.sessionReplay.sessionSampleRate = 0.1  // 10%
    options.sessionReplay.onErrorSampleRate = 1.0  // 100% on error
    options.enableLogs = true
}

Size Analysis (Fastlane)

Track app bundle size with Sentry using the Fastlane plugin.

Install Plugin

bundle exec fastlane add_plugin fastlane-plugin-sentry

Configure Authentication

# Environment variable (recommended for CI)
export SENTRY_AUTH_TOKEN=your_token_here

Or create .sentryclirc (add to .gitignore):

[auth]
token=YOUR_SENTRY_AUTH_TOKEN

Fastfile Lane

lane :sentry_size do
  build_app(
    scheme: "YourApp",
    configuration: "Release",
    export_method: "app-store"
  )

  sentry_upload_build(
    org_slug: "your-org",
    project_slug: "your-project",
    build_configuration: "Release"
  )
end

Run Size Analysis

bundle exec fastlane sentry_size

View results in the Sentry UI after the upload completes.

Troubleshooting

IssueSolution
Events not appearingCheck DSN, enable debug = true
No tracesSet tracesSampleRate > 0
No replaysSet sessionSampleRate > 0, check SDK 8.31.1+. On iOS 26+/Xcode 26+ see Liquid Glass caveat above
No logsSet enableLogs = true (SDK 9.0.0+) or experimental.enableLogs = true (SDK 8.55.0-8.x)
CocoaPods failsRun pod repo update, check iOS 15+ target
Size upload failsCheck SENTRY_AUTH_TOKEN, verify org/project slugs

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.59%
按下载量换算46

Claude

29.75%
按下载量换算40

Cursor

20.78%
按下载量换算28

Gemini CLI

10.84%
按下载量换算14

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills