---
title: "Manual Setup"
description: "Learn how to set up the SDK manually."
url: https://docs.sentry.io/platforms/apple/guides/ios/manual-setup/
---

# Manual Setup | Sentry for iOS

If you can't (or prefer not to) run the [automatic setup](https://docs.sentry.io/platforms/apple/guides/ios.md#install), you can follow the instructions below to configure your application manually.

## [Installation](https://docs.sentry.io/platforms/apple/guides/ios/manual-setup.md#installation)

The minimum required version for iOS is 11.0.

We recommend installing the SDK with SPM, but we also support alternate [installation methods](https://docs.sentry.io/platforms/apple/guides/ios/install.md). To integrate Sentry into your Xcode project, add the package using the Github URL:

```bash
https://github.com/getsentry/sentry-cocoa.git
```

The Package has a few products you can depend on, but the recommended one is `Sentry`. For more details see the full docs on using [Swift Package Manager](https://docs.sentry.io/platforms/apple/guides/ios/install/swift-package-manager.md).

## [Configuration](https://docs.sentry.io/platforms/apple/guides/ios/manual-setup.md#configuration)

We recommend initializing the SDK on the main thread as soon as possible – in your AppDelegate `application:didFinishLaunchingWithOptions` method, for example:

```swift
import Sentry // Make sure you import Sentry

// ....

func application(_ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

    SentrySDK.start { options in
        options.dsn = "___PUBLIC_DSN___"
        options.debug = true // Enabled debug when first installing is always helpful

        // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
        // We recommend adjusting this value in production.
        options.tracesSampleRate = 1.0
    }

    return true
}
```

If you're using SwiftUI and your app doesn't implement an app delegate, initialize the SDK within the [App conformer's initializer](https://developer.apple.com/documentation/swiftui/app/main\(\)):

```swift
import Sentry

@main
struct SwiftUIApp: App {
    init() {
        SentrySDK.start { options in
            options.dsn = "___PUBLIC_DSN___"
            options.debug = true // Enabled debug when first installing is always helpful

            // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
            // We recommend adjusting this value in production.
            options.tracesSampleRate = 1.0
        }
    }
}
```
