4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Flutter🐬コマンド一発で、android と iOS 両方にアップロードしたいしデプロイしたいんだ!

Posted at

前書き

Flutter でアプリをデプロイするのに、いちいちandroid と ios のコマンド打つのも面倒だし、ビルドナンバーをインクリメントするのも面倒くさい!

コマンド一発で、全部済ませたいんだ!!

env ファイルの作成

.env
ANDROID_UPLOAD_LINK: https://~~~

deploy.sh を作成

deploy.sh
#!/bin/bash

iosDeploy() {
  echo "🍎 iOS build started 🚀🚀🚀"
  flutter build ipa --release --export-options-plist=ExportOptions.plist
  echo "🍎 iOS build finished 🎉🎉🎉"
}

androidDeploy() {
  echo "🍏 Android build started 🚀🚀🚀"
  flutter build appbundle
  open -R ./build/app/outputs/bundle/release/app-release.aab
  open $ANDROID_UPLOAD_LINK
  echo "🍏 Android build finished 🎉🎉🎉"
}


# Increment version
perl -i -pe 's/^(version:\s+\d+\.\d+\.\d+\+)(\d+)$/$1.($2+1)/e' pubspec.yaml

source .env
# Deploy
iosDeploy &
androidDeploy &

wait
echo "Both builds finished 🎉🎉🎉"

deploy.sh に実行権限を付与

chmod +x deploy.sh

実行🦄

./deploy.sh

SAYONARA

4
2
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
4
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?