😊

FVMを使ったFlutter環境構築(Mac)

に公開

前提

Homebrewがインストールされている。

flutterSDKのインストール

  1. brew udpate
  2. brew install --cask flutter
  3. flutter --version

バージョンが表示され、インストールされていることを確認。

(appleシリコンを利用しているMacのみ)Rosetta2のインストール

  1. sudo softwareupdate --install-rosetta --agree-to-license

Install of Rosetta 2 finished successfullyと出力されていることを確認。

iOSのセットアップ

  1. flutter doctor

出力された内容に従ってインストールを実施する。(チェックが付いているものは不要)

  1. WebまたはAppStoreからXcodeをインストール

https://apps.apple.com/us/app/xcode/id497799835

  1. インストールが完了したら指示通りにコマンドを実行

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

  1. CocoaPodsをインストール

sudo gem install cocoapods
pod --v
https://guides.cocoapods.org/using/getting-started.html#installation

Xcodeの横にチェックが付いていることを確認。

Androidのセットアップ

  1. flutter doctor

出力された内容に従ってインストールを実施する。(チェックが付いているものは不要)

  1. WebからAndroidStudioをインストール(今回はHomebrew経由でインストール)

brew install --cask android-studio

  1. インストールが完了したらアプリを起動。初期設定を進める
    https://zenn.dev/noe489/articles/b5a3571770250b#3-2.androidstudioの初期設定

  2. Androidの各種ライセンスに同意

flutter doctor --android-licenses

Android studioの横にチェックが付いていることを確認。

fvmのインストール

  1. brew tap leoafarias/fvm
  2. brew install fvm
  3. fvm --version

バージョンが表示され、インストールされていることを確認。

  1. fvm install [version]

例:fvm install 3.22.2

  1. fvm list

参考

https://zenn.dev/noe489/articles/b5a3571770250b
https://docs.flutter.dev/get-started/install/macos/mobile-ios
https://zenn.dev/altiveinc/articles/flutter-version-management-3
https://fvm.app/documentation/getting-started/installation

Discussion