所要時間は1時間程度。
前提
- Macを使っている(macOS Catalina version 10.15.1)
- Xcodeインストール済み(version 11.2)
- Android Studioインストール済み(version 3.5)
※Flutterディレクトリを/Applications
配下に置いたので、その前提でコマンドを書いています
手順
Flutter本体のインストール
- 公式サイトから.zipをダウンロード macOS install - Flutter
- 解凍して、任意の場所に配置(今回は
/Applications
配下に置いた) - パスを通してflutterコマンドを使えるようにする
$ export PATH=“$PATH:/Applications/flutter/bin”`
- 必要な準備できているかを確認
$ flutter doctor
flutter doctor
でチェックがつかなかった項目への対応
「Xcodeも入れてるし、Android Studioも入れてるから、ほぼ設定終わってるのでは?」と思っていたら、5個中4つチェックがつかなかったので一つ一つ対応した。
Android toolchain
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor
—android-licenses
書いてある通りのコマンドを実行
$ flutter doctor —android-licenses
「“idevice_id”は、開発元を検証できないため開けません。」という警告ダイアログが出たので、こちらのサイトを参考に以下のコマンドを叩く
$ sudo xattr -d com.apple.quarantine /Applications/flutter/bin/cache/artifacts/libimobiledevice/idevice_id`
再度flutter doctor —android-licenses
をすると何度もAccept? (y/N):
と聞かれるので、ひたすらy
で答える
→All SDK package licenses accepted
と出てクリア
Xcode
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS
development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select —switch /Applications/Xcode.app/Contents/Developer
Xcodeのダウンロードは済んでいるので、書いてある通りのコマンドを実行
$ sudo xcode-select —switch /Applications/Xcode.app/Contents/Developer
再度flutter doctor
をしてみると、文言が変わっている↓
[!] Xcode - develop for iOS and macOS (Xcode 11.2)
✗ Xcode requires additional components to be installed in order to run.
Launch Xcode and install additional required components when prompted.
こちらのサイトを参考に以下のコマンドを叩く
$ sudo xcodebuild -runFirstLaunch
再度flutter doctor
をしてみると、チェックマークがつきクリア
Android Studio
[!] Android Studio (version 3.5)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
Android Studio > Preferences > PluginsのMarketplaceタブから、Flutter
プラグインをインストール。
Dart
プラグインも一緒にインストールするか聞かれるので、Yesをクリック。

緑のボタンを押して再起動。
再度flutter doctor
をしてみると、チェックマークがつきクリア
Flutterを起動する
最後に念のため起動してみる。
flutter doctor
で全てにチェックがついたことを確認。
Android Studioを起動してみると、Start a new Flutter project
というボタンが追加されている。