しめ鯖日記

swift, iPhoneアプリ開発, ruby on rails等のTipsや入門記事書いてます

【fastlane】1プロジェクトに複数アプリの入っている場合のメタデータ管理

1つのプロジェクトで複数アプリをリリースしている場合のメタデータ管理方法です。
複数アプリが全く同じメタデータならいいのですが、アイコンやスクリーンショットを別々にする場合少し工夫をする必要があります。

fastlaneの設定方法はこちらをご参照下さい。

www.cl9.info

複数アプリ対応

まずは1アプリに対応します。
プロジェクトのルートで以下コマンドを実行します。

fastlane init

アプリのメタデータが以下のような構成でダウンロードされます。

f:id:llcc:20161225203212p:plain

2つ目以降のアプリは以下のように別フォルダを指定してダウンロードします。

fastlane deliver download_screenshots --app_identifier com.example.other  --screenshots_path fastlane/screenshots_other_app
fastlane deliver download_metadata --app_identifier com.example.other  --metadata_path fastlane/metadata_other_app

これで別アプリのメタデータがフォルダに保存されます。

f:id:llcc:20161225203757p:plain

別アプリへのメタデータのアップロードは以下のようにオプション付ける事で実現できます。

fastlane deliver --app_identifier com.example.other  --screenshots_path fastlane/screenshots_other_app --metadata_path fastlane/metadata_other_app

上コマンドはFastfileに登録しておけば簡単に実行できるようになります。

fastlane update_metadata_other_app 
platform :ios do
  lane :update_metadata_other_app do
    deliver(
      app_identifier: 'com.example',
      screenshots_path: 'fastlane/screenshots_other_app',
      metadata_path: 'fastlane/metadata_other_app',
    )
  end
end