1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Mac】Flutter管理ツールfvmを使って環境構築する

1
Last updated at Posted at 2026-09-20

今回は、Flutterのバージョン管理ツールであるfvmを使って環境構築する手順を紹介します。

環境

Mac

事前準備

Homebrewのインストール

パッケージマネージャーHomebrewをインストールします。

ターミナルで下記のコマンドを入力します。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

すると管理者のパスワードを求められるので、入力します。
パスワード入力後にHomebrewのインストールが始まります。

インストール完了後にパスの設定を求められるので、ターミナル上で下記のコマンドを入力します。

echo >> /Users/<ユーザー名>/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> /Users/<ユーザー名>/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"

Homebrewが正常にインストールできたかどうかを確認するためにターミナルに下記のコマンドを入力します。

brew --version

Dart のリポジトリをbrewで登録する

下記のコマンドを使って登録します。

brew trust dart-lang/dart

dart-lang/dartは第三者ライブラリで信頼するかどうかであるため、trustキーワードをつけてインストールすることが必要です。

Dart SDK のインストール

下記のコマンドを使ってインストールします。

brew install dar

パスを通します。

echo 'export PATH="/opt/homebrew/opt/dart/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

Dartがインストールされているかを確認するために下記のコマンドを入力します。

dart --version

fvmをインストール

下記のコマンドを使ってインストールします。

dart pub global activate fvm

パスを通します。

export PATH="$PATH":"$HOME/.pub-cache/bin"

指定したfvmをインストール

下記のように指定したバージョンをインストールします。

fvm global 3.3.10

最後に、flutterのバージョンの確認するために下記のコマンドを入力します。

fvm flutter --version

トラブルシューティング

プロジェクト作成コマンドfvm flutter create xxxするとcommand not found fvmと表示される

(原因)
fvmのパスが通っていないことが原因

(解決方法)
下記のコマンドを入力してfvmのバージョンを確認します。

dart pub global list

次に、fvmが配置されているパスを下記のコマンドを使って確認します。

ls ~/.pub-cache/bin/fvm

fvmの配置パスが表示されたら、下記のコマンドを使って.zshrcファイルへ書き込みします。

echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.zshrc
source ~/.zshrc

FVM(Flutterのバージョン管理)の導入手順と使い方

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

fvmで指定したバージョンのFlutterをインストールする

Flutterの環境構築はここまで簡単になった!(Mac 編)

【Flutter】Android Studioで開発環境を用意する方法(Mac編)

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?