iOSエンジニアのつぶやき

毎朝8:30に iOS 関連の技術について1つぶやいています。まれに釣りについてつぶやく可能性があります。

Fastlane での Rebuild from Bitcode オプションの付け方

Bitcode とは?

iOS9から導入された技術で LLVM中間言語のことを指します。以前まではコンパイルが完了しているものを Apple に提出していましたが、Bitcode を用いることで Apple 側で最適化してコンパイルを行えるようになります。

Bitcode を用いたくない場合

基本的にアプリで Bitcode を有効にする場合は、依存しているライブラリなども全て Bitcode に対応している必要があります。そのため、Carthage などでコンパイル済みのバイナリを使用するような時にライブラリの Bitcode が有効になっていない場合はアプリを配信するときなどにプロジェクトの Bitcode を無効にする必要があります。

Xcode から配信する場合

Rebuild from Bitcodeチェックボックスを外せば無効にできます。

f:id:yum_fishing:20200808195237p:plain

Fastlane から配信する場合

export_optionscompileBitcode の項目を追加することで Bitcode でのコンパイルを制御できるようになります。

  lane :adhoc do
    match(type: "adhoc", app_identifier: "hoge.com", force_for_new_devices: true, readonly: true)
    gym(
      workspace: WORKSPACE,
      scheme: SCHEME,
      configuration: "Staging",
      export_method: "ad-hoc",
      export_options: { compileBitcode: false }
    )
    firebase_app_distribution(
              app: "hogehoge",
              testers: "hogehoge@hoge.com",
              release_notes: "Lots of amazing new features to test out!",
              firebase_cli_path: "./node_modules/.bin/firebase"
    )
  end

参考

docs.fastlane.tools

その他の記事

yamato8010.hatenablog.com

yamato8010.hatenablog.com

yamato8010.hatenablog.com