Swift Package Manager (SPM)

Add the Sentry Cocoa SDK as a package in Xcode in your iOS app via File > Add Packages. Enter the Git repo URL in the search field:

Copied
https://github.com/getsentry/sentry-cocoa.git

Define your dependency rule to have the exact version 8.4.0 and then click the "Add Package" button.

Alternatively, if your

projectRepresents your service in Sentry and allows you to scope events to a distinct application.
uses a Package.swift file to manage dependencies, you can specify the target with:

Copied
.package(url: "https://github.com/getsentry/sentry-cocoa", from: "8.4.0"),

Next, install the Kotlin Multiplatform SDK and setup your Apple targets by adding the following to your build.gradle.kts file in your shared module:

shared/build.gradle.kts
Copied
repositories {
    mavenCentral()
}

kotlin {
  listOf(
    iosX64(),
    iosArm64(),
    iosSimulatorArm64()
  ).forEach {
    it.binaries.framework {
        baseName = "shared"
        isStatic = true // currently available only as static framework
    }
  }

  sourceSets {
    val commonMain by getting {
      dependencies {
        implementation("io.sentry:sentry-kotlin-multiplatform:0.2.1")
      }
    }

    // Apple targets:
    val iosMain by getting {
      dependsOn(commonMain)
    }

    // Other targets...
  }
}
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").