Step1. インストール
- 印刷する
 
Step1. インストール
- 印刷する
 
記事の要約
この要約は役に立ちましたか?    
ご意見ありがとうございます
次のいずれかの方法を選択して Shoplive iOS SDKをインストールします。
重複してインストールしないでください。
Shoplive iOS SDKは、Swift Package Manager、またはCocoaPodsどちらかの方法でインストールする必要があります。
方法1 : CocoaPodsを使用してインストールする
1. CocoaPodsを設定します。
# In project home directory
cd ~/projects/PlayShopLive
# If you don't have CocoaPods
sudo gem install cocoapods
# If your project didn't have CocoaPods initialized
pod init2. 現在使用している Podfileに、以下の行を追加します。
.png)
source 'https://github.com/CocoaPods/Specs.git'
    # Set it to the same minimum supported version as configured in your project.
    # The Shoplive iOS SDK supports iOS 11.0 and above. It cannot be configured for versions below iOS 11.0.
    platform :ios, '11.0'
    use_frameworks!
    # Please configure the Project Target for installing the Shoplive iOS SDK.
    target 'PlayShopLive' do
        pod 'ShopLive', '1.5.4'
        pod 'ShopliveSDKCommon', '1.5.4'
    end3. CocoaPodsをインストールします。
# Run the installation command in the Project home directory.
# Include the update command to ensure that the changes from the pod repository are reflected.
# Method 1. pod repo update and, pod install sequentially
pod repo update
pod install
# Method 2. pod repo update and pod install together
pod install --repo-updateApple M1 で機能しない場合は、次のコマンドを実行します。
sudo arch -x86_64 gem install ffi arch -x86_64 pod install
4. インストールが完了したら、 Project - Finderによって生成されたファイルを確認します。

5. xcworkspace ファイルを開いて Project を確認します。
.png)
方法2 : Swift Package Managerを使用してインストールする
1. Xcodeプロジェクト内のProjectPackage Dependenciesタブを開きます。
.png)
2. Package Dependencies に、以下を追加してください。
dependencies: [
    .package(url: "https://github.com/shoplive/ios-sdk", .exact(from: "1.5.5")),
    .package(url: "https://github.com/shoplive/common-ios", .exact(from: "1.5.5"))
]インストールに失敗した場合は、キャッシュをクリアしてください。
.png)
3. Shoplive iOS SDKパッケージ を 適用する対象を選択します。
.png)
4. Package Dependencies に Shoplive iOS SDKがインストールされていることを確認してください。
.png)