For AI agents: a documentation index is available at /docs/llms.txt. Append .md to any page URL for markdown, or send Accept: text/markdown.
Install an Amplitude mobile SDK
This quickstart installs an Amplitude SDK in a mobile app. Pick your platform: iOS (Swift), Android (Kotlin), React Native, or Flutter. Each platform takes three steps: install, initialize, and track your first event.
Prerequisites
- An Amplitude project and its API key. Create a free Amplitude account if you need one.
- Access to your app's codebase.
Install the SDK
The Unified SDK for Swift includes Analytics, Experiment, and Session Replay.
Install
Add the SDK to your Xcode project
Choose Swift Package Manager or CocoaPods to install the Unified SDK.
Swift Package Manager: In Xcode, navigate to File > Add Package Dependencies and enter:
texthttps://github.com/amplitude/AmplitudeUnified-SwiftCocoaPods: Add to your
Podfile, then runpod install:rubypod 'AmplitudeUnified', '~> 0.0.4'Initialize
Initialize the SDK
Add this to your app delegate or
@mainentry point:swiftimport AmplitudeUnified let amplitude = Amplitude(apiKey: "AMPLITUDE_API_KEY")Track
Track your first event
swiftamplitude.track(eventType: "Button Clicked")
For full configuration options, refer to Unified SDK for Swift.
Confirm that events arrive
After you track your first event, open the Amplitude Debugger to confirm that it reaches your project.
Was this helpful?