複数のXcodeがインストールされている環境でFlutterを使う

アプリケーションフォルダーには以下の2つのバージョンのXcodeが入っている

  • /Applications/Xcode 13.4.app
  • /Applications/Xcode 14.1.app

「flutter doctor」を実行するとXcodeが見つかっていない。

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.7, on macOS 12.6 21G115 darwin-arm, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.

今回、FlutterはXcode 14.1.appを使用するように設定する。

以下のコマンドを実行する。
xcode-selectの引数にXcode 14.1.appのパスを指定する。

sudo xcode-select --switch "/Applications/Xcode 14.1.app/Contents/Developer"
sudo xcodebuild -runFirstLaunch

「flutter doctor」を実行すると成功した。

% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください