※※※
作成中
※※※
開発環境
PC:macOS Sequoia
エディター:Visual Studio Code
Xcode: 16.1
Android Sutudio: Meerkat Feature Drop | 2024.3.2
バージョン管理
- asdf: 0.16.5
- flutter: 3.29.3-stable
- ruby: 3.3.0
前提条件
- iOS, Android アプリがそれぞれビルドできる状態
- 個人のアカウントで行う(組織アカウントではない)
- Xcode に Apple ID が登録済み(サインインしている)
ゴール
- fastlane を使用して iOS, Android アプリをビルド、ストアへのアップロード(テスト)までlocal 環境で行えるようにする
スコープ外
- github actions や Bitrise, 他のサービスを使用した CD
準備
fastlaneの公式に従って、fastlaneを導入する。
※本環境では、homebrew でインストール
内容
iOS
初期化
ios ディレクトリに移動して、以下のコマンドを実行
fastlane init
fastlane init 実行時の質問
今回は TestFlight にアップロードするので、2 を選択する.
What would you like to use fastlane for?
1. 📸 Automate screenshots
2. 👩✈️ Automate beta distribution to TestFlight
3. 🚀 Automate App Store distribution
4. 🛠 Manual setup - manually setup your project to automate your tasks
自身の Apple ID(Apple DEveloper で登録しているメールアドレス)を入力する.
Please enter your Apple ID developer credentials
Apple ID Username:
App Store Connect でアプリがない場合は下記について聞かれる.
App ID を作成したり、App Store Connectにアプリを作成するかを聞かれるので、お好みで y or n を入力する
Do you want fastlane to create the App ID for you on the Apple Developer Portal? (y/n)
App Name:
Would you like fastlane to create the App on App Store Connect for you? (y/n)
App Name:
/ios/fastlane ディレクトリ配下に以下のファイルが生成される
- Appfile
app_identifier("com.exsample.hogehoge") # The bundle identifier of your app
apple_id("test@icloud.com") # Your Apple Developer Portal username
itc_team_id("1234567890") # App Store Connect Team ID
team_id("AAA1122334") # Developer Portal Team ID
- Fastfile
default_platform(:ios)
platform :ios do
desc "Push a new beta build to TestFlight"
lane :beta do
increment_build_number(xcodeproj: "Runner.xcodeproj")
build_app(workspace: "Runner.xcworkspace", scheme: "Runner")
upload_to_testflight
end
end
ビルド & TestFight へのアップロード(作成中)
発生したエラー
build_app で発生したエラー
- Exit status: 65
Xcode でアカウントがサインインしていなかったため、Team を確認して、サインイン。
- Exit status: 70
Fastfile に以下の変更を行った
- build_app(workspace: "Runner.xcworkspace", scheme: "Runner")
+ build_app(
+ workspace: "Runner.xcworkspace",
+ scheme: "Runner",
+ export_method: "app-store"
+ )
Android(作成中)
-
初期化
-
ビルド
-
playStore へのアップロード