Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fapple%2Fios.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fuser-guides%2Frum%2Fsdk-installation%2Fapple%2Fios.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

# Official Coralogix SDK for iOS

## Overview[​](#overview "Direct link to Overview")

The Coralogix RUM Mobile SDK is a library for iOS, distributed through Swift Package Manager and CocoaPods. The SDK provides mobile Telemetry instrumentation that captures:

1. HTTP requests, using URLSession instrumentation
2. Unhandled exceptions (NSException, NSError, Error)
3. Custom Logs
4. Crashes - using PLCrashReporter
5. Page navigation (Swift use swizzling / SwiftUI use modifier)
6. User Actions (Clicks - UI elements)
7. ANR (Application Not Responding) detection
8. Mobile Vitals (FPS, CPU, Memory, Cold Start, Warm Start, Slow/Frozen Frames)

## Requirements[​](#requirements "Direct link to Requirements")

Coralogix RUM agent for iOS supports iOS 13 and higher.

## Installation[​](#installation "Direct link to Installation")

The integration requires minimal effort with a few lines of code. The SDK can be installed with Swift Package Manager or CocoaPods.

### Swift package manager[​](#swift-package-manager "Direct link to Swift package manager")

1. Open **File > Add Package Dependencies**.
2. Search for `git@github.com:coralogix/cx-ios-sdk`.
3. Select the **Up to Next Major Version** option.

### CocoaPods[​](#cocoapods "Direct link to CocoaPods")

Add the Coralogix pod to your `Podfile`:

```
pod 'Coralogix'

pod 'SessionReplay'  # Only if you use Session Replay
```

Then run `pod install` from your project root.

### Initialization[​](#initialization "Direct link to Initialization")

Remember to call this as early in your application life cycle as possible. Ideally in `applicationDidFinishLaunching in your AppDelegate`

```


import UIKit

import Coralogix



  



@main



class AppDelegate: UIResponder, UIApplicationDelegate {



var coralogixRum: CoralogixRum?



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

    let domain = CoralogixDomain.US2

    let options = CoralogixExporterOptions(coralogixDomain: CORALOGIX-DOMAIN,

                                           environment: "ENVIRONMENT",

                                           application: "APP-NAME",

                                           version: "APP-VERSION",

                                           publicKey: "API-KEY")

    self.coralogixRum = CoralogixRum(options: options)

    return true

}
```

Or if you are using `swiftUI`

```


import SwiftUI

import Coralogix



@main



struct DemoAppApp: App {

    @State private var coralogixRum: CoralogixRum

    init() {

        let domain = CoralogixDomain.US2

        let options = CoralogixExporterOptions(coralogixDomain: CORALOGIX-DOMAIN,

                                           environment: "ENVIRONMENT",

                                           application: "APP-NAME",

                                           version: "APP-VERSION",

                                           publicKey: "API-KEY")

        self.coralogixRum = CoralogixRum(options: options)

    }

    

    var body: some Scene {

        WindowGroup {

            ContentView(coralogixRum: $coralogixRum)

        }

    }

}
```

## Example apps[​](#example-apps "Direct link to Example apps")

The repository includes two fully-featured demo apps under `Example/`:

| App              | Target  | Description                                              |
| ---------------- | ------- | -------------------------------------------------------- |
| `DemoAppSwift`   | UIKit   | Reference implementation — all instrumentation scenarios |
| `DemoAppSwiftUI` | SwiftUI | SwiftUI port — same scenarios, native SwiftUI patterns   |

Both apps cover: Network instrumentation, Error instrumentation, SDK functions, Custom spans, User Actions (tap/scroll/swipe), Session Replay, Traces Exporter, Schema Validation, Mask UI, and Clock.

**To run locally:**

1. Open `Example/DemoApp.xcworkspace` in Xcode.
2. Select the `DemoAppSwift` or `DemoAppSwiftUI` scheme.
3. Fill in your credentials in `Example/Shared/Envs.swift` (API key, proxy URL).
4. Run on a simulator or device.

**E2E UI tests** (requires a running validation proxy):

```
# UIKit

xcodebuild test \

  -workspace Example/DemoApp.xcworkspace \

  -scheme DemoAppSwift \

  -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' \

  -only-testing:DemoAppUITests



# SwiftUI

xcodebuild test \

  -workspace Example/DemoApp.xcworkspace \

  -scheme DemoAppSwiftUI \

  -destination 'platform=iOS Simulator,name=iPhone 16,OS=18.5' \

  -only-testing:DemoAppSwiftUIUITests
```

## License[​](#license "Direct link to License")

This project is licensed under the MIT License - see the [LICENSE](https://github.com/coralogix/cx-ios-sdk/blob/master/LICENSE) file for details.
