# Installation

Our Flagship SDK is available for distribution through CocoaPods, Swift Package Manager

#### Cocoapods

1. [Install CocoaPods](https://guides.cocoapods.org/)
2. Open Terminal and browse to the directory that contains your project then, enter the following command: `pod init`
3. Open your Podfile and add the following line to the Podfile

```ruby
target 'Your App' do
    use_frameworks!

    pod 'FlagShip'

    end
```

4. Run `pod install` from your Xcode project's base directory
5. Make sure you always open the Xcode workspace and not the project file when building your project

#### Swift Package Manager (SPM)

You can search for **Flagship** package on GitHub.

Add your GitHub or GitHub Enterprise account in Xcode’s preferences, and a package repository appear as you type.

For more information about Swift Package Manager, [refer to Apple documentation](https://developer.apple.com/documentation/xcode/adding_package_dependencies_to_your_app).

#### Carthage

1. Install [Carthage](https://github.com/Carthage/Carthage#installing-carthage)
2. Create a Cartfile in the same directory where your .xcodeproj or .xcworkspace is.
3. Add this line to the Cartfile

```ruby
github "flagship-io/flagship-ios" ~> 4.0.2
```

4. Run `carthage update --use-xcframeworks`
5. A Cartfile.resolved file and a Carthage directory will appear in the same directory where your .xcodeproj or .xcworkspace is.
6. Drag the built Flagship.xcframework bundles from Carthage/Build into the "Frameworks, Libraries, and Embedded Content" section of your application’s Xcode project.

For More information refer to [Carthage](https://github.com/Carthage/Carthage)
