CatHand Blog

アプリ開発やMac弄り

BitriseでflutterのmacOSアプリをビルドしてAppStore Connectへアップロードする

Workflowは↑のようなかんじになります。

Flutter Install

必要なバージョンのFlutterをインストールします。今回は 3.0.1 を使いました。

Script

flutter build macos します。

ただし、必ず

error: Provisioning profile "******" doesn't include the currently selected device ....

のようなエラーが起きます。次のステップでビルドするのでこのエラーは無視します。

結果、↓のようなスクリプトとなります。

#!/usr/bin/env bash
# fail if any commands fails
# set -e
# make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully
# set -o pipefail
# debug log
set -x

flutter build macos

exit 0

Xcode Archive for Mac

RunnerプロジェクトからmacOSアプリのビルドを行います。

Export methodには app-store を指定した上で、Custom export options plist content を指定する必要があります。

この値には、一度ローカルのXcodeでRunnerプロジェクトをアーカイブしてAppStore用にExportして、出来上がったフォルダ内の ExportOptions.plist の中身を指定します。

Deploy to App Store Connect - Application Loader (formerly iTunes Connect)

AppleIDの認証情報等を指定してAppStore Connectへアップロードします。

プロビジョニングプロファイルや証明書の指定が正しければアップロードできるはずです。