mcpField
S
setup-fastlane

setup-fastlane

github.com/greenstevesterクラウド・DevOps3866 回インストール8 週間前に更新
リポジトリ

setup-fastlane について

iOS プロジェクトで Fastlane を設定するスキルです。テストや App Store 配信を自動化したい開発者向けに、プロジェクト情報の確認から設定ファイル作成までを支援します。

主な機能

  1. 01Xcode、Homebrew、Fastlane の確認
  2. 02プロジェクトや Bundle ID の検出
  3. 03Appfile と Fastfile の作成
  4. 04テスト、ベータ、リリース用 lane の設定
  5. 05App Store メタデータとスクリーンショットの取得

活用シーン

  1. 01iOS プロジェクトへの Fastlane 導入
  2. 02テスト実行と TestFlight へのアップロード
  3. 03App Store リリース手順の準備

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/greenstevester/fastlane-skill --skill setup-fastlane

インストール後、Claude Code で/setup-fastlaneを入力して読み込まれたか確認します。

詳細

Fastlane のセットアップ(初回のみ)

┌─────────────────────────────────────────────────────────────────┐
│  ONE-TIME SETUP                                                 │
│  ══════════════                                                 │
│  After this, you'll have:                                       │
│                                                                 │
│    fastlane ios test    → Run tests                             │
│    fastlane ios beta    → Upload to TestFlight                  │
│    fastlane ios release → Submit to App Store                   │
│                                                                 │
│  Do this once per project. Takes ~10 minutes.                   │
└─────────────────────────────────────────────────────────────────┘
環境チェック
  • Xcode CLI:!xcode-select -p 2>/dev/null && echo "✓" || echo "✗ Run: xcode-select --install"
  • Homebrew:!brew --version 2>/dev/null | head -1 || echo "✗ Run: /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)\""
  • Fastlane:!fastlane --version 2>/dev/null | grep -o "fastlane [0-9.]*" | head -1 || echo "✗ Run: brew install fastlane"
プロジェクト
  • プロジェクト:!find . -maxdepth 2 -name "*.xcodeproj" 2>/dev/null | head -1 || echo "None found"
  • ワークスペース:!find . -maxdepth 2 -name "*.xcworkspace" ! -path "*/.build/*" ! -path "*/xcodeproj/*" 2>/dev/null | head -1 || echo "None"
  • バンドル ID:!grep -r "PRODUCT_BUNDLE_IDENTIFIER" --include="*.pbxproj" . 2>/dev/null | head -1 | sed 's/.*= //' | tr -d '";' || echo "Not found"
  • チーム ID:!grep -r "DEVELOPMENT_TEAM" --include="*.pbxproj" . 2>/dev/null | head -1 | sed 's/.*= //' | tr -d '";' || echo "Not found"
対象:${ARGUMENTS:-current directory}

ステップ 1:Fastlane をインストールする

brew install fastlane

Homebrew を使う理由は? Bundler 4.x により Fastlane の Ruby 依存関係に問題が発生しました。Homebrew を使えば、バージョンの競合をすべて回避できます。


ステップ 2:設定ファイルを作成する

fastlane/Appfile
app_identifier("{{BUNDLE_ID}}")  # Your bundle ID
apple_id("{{APPLE_ID}}")         # Your Apple ID email
team_id("{{TEAM_ID}}")           # Your team ID
fastlane/Fastfile
default_platform(:ios)

platform :ios do
  desc "Run tests"
  lane :test do
    scan(scheme: "{{SCHEME}}")
  end

  desc "Upload to TestFlight (internal testers)"
  lane :beta do |options|
    increment_build_number unless options[:skip_build_increment]
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    pilot(skip_waiting_for_build_processing: true)
  end

  desc "Upload to TestFlight and distribute to external testers"
  lane :beta_external do |options|
    increment_build_number
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    pilot(
      distribute_external: true,
      groups: ["External Testers"],
      changelog: options[:changelog] || "Bug fixes and improvements",
      skip_waiting_for_build_processing: false
    )
  end

  desc "Submit the latest TestFlight build for App Store review"
  lane :release do
    deliver(
      build_number: latest_testflight_build_number.to_s,
      submit_for_review: true,
      automatic_release: false,
      force: true,
      skip_binary_upload: true,
      skip_metadata: false,
      skip_screenshots: false
    )
  end

  desc "Build, upload, and submit a fresh build to the App Store"
  lane :release_full do |options|
    increment_version_number(version_number: options[:version]) if options[:version]
    increment_build_number
    gym(scheme: "{{SCHEME}}", export_method: "app-store")
    deliver(
      submit_for_review: true,
      automatic_release: options[:auto_release] == true,
      force: true
    )
  end
end

{{SCHEME}} をアプリのスキーム名(通常はアプリ名)に置き換えてください。


ステップ 3:メタデータを設定する(任意)

既存の App Store の掲載情報をダウンロードします。

fastlane deliver download_metadata
fastlane deliver download_screenshots

これにより、アプリの説明やキーワードなどを編集できるテキストファイルを含む fastlane/metadata/ が作成されます。


完了です!

# Verify setup
fastlane lanes

# Run your first lane
fastlane ios test
クイックリファレンス
コマンド実行内容
fastlane ios testテストを実行
fastlane ios betaビルド + TestFlight
fastlane ios releaseビルド + App Store
fastlane deliver download_metadataApp Store の掲載情報を取得

次のステップ

  • コード署名に問題がありますか? 「コード署名用に Match を設定して」と尋ねてください
  • スクリーンショットが必要ですか? 「App Store のスクリーンショットを自動化して」と尋ねてください
  • CI/CD のセットアップですか? Xcode Cloud ガイドをご覧ください

コメント