LoginSignup
2
3

More than 3 years have passed since last update.

Bitriseのナンバリングを利用して、バージョンの自動インクリメントを実現(ReactNative, ios)

Last updated at Posted at 2019-08-30

下記記事でFastlaneをBitriseに組み込み、MyAppへの自動デプロイを実現しました。
FastlaneのコマンドをBitriseに組み込む(ios,ReactNative)
しかし、開発の現場ですとデプロイ毎にバージョン番号を繰り上げて管理したいです。
そこで利用するのが、Bitriseのナンバリング番号です。

android版はこちら↓
Bitriseのナンバリングを利用して、バージョンの自動インクリメントを実現(ReactNative, android)

Bitriseのナンバリング番号とは

Build numbering and app versioning
Bitriseのworkflowが動く際に管理されている番号のことです。
実行毎に番号が繰り上がるため、この番号をバージョン番号として使用しようと思います。

image.png

設定

Bitriseのをworkflowを編集します。
fastlaneフローの前にSet Xcode Project Build Numberを挿入します。
image.png

設定を記述します。
Info.plist file pathにios/アプリ名/info.plist
Build Numberに$BITRISE_BUILD_NUMBER
image.png

これに伴い下記記事で作成したファイルのincrementの機能は不要になるため、該当部分を削除します。
fastfileの編集

ios/fastlane/Fastfile
desc "Push a new release build to the App Store"
  lane :release do
    # increment機能は不要のため、削除
    # increment_build_number(xcodeproj: "ReactNativePlatform.xcodeproj")

    match(type: "appstore")
    build_app(scheme: "ReactNativePlatform")
    upload_to_app_store(
      skip_waiting_for_build_processing: true
    )
    clean_build_artifacts
  end

実行

上記設定でBitriseが動きますと、MyAppにてバージョン番号がBitriseのナンバリング番号と一致しているのが確認できます。
image.png

参考

iOSアプリのビルド番号自動設定をfastlaneまたはBitriseでラクラク実現する方法

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3