flutter install
Install
1. sdk download
まずは公式サイトからファイルのダウンロードをします。
- Get the Flutter SDK
- https://flutter.dev/docs/get-started/install
2. ファイルの配置
ファイルを解凍し、任意の場所に配置
どこでも良いがあとでパスを通す必要あるのでわかりやすい場所に。
(ホームディレクトリー直下にflutterを作って解凍したファイルを置く場合)
$ cd ~
$ mkdir flutter
3. binにpathを通す
.bash_profileなどに記述。
(このあたりはお使いの環境に合わせて設定ください。)
// PATHの記述がない場合
export PATH=$HOME/flutter/bin:$PATH
// すでにPATHの記述がある場合
export PATH=$PATH:$HOME/flutter/bin
4. pathの確認
コマンドが通るか確認。
”which flutter”でパスが返ってこればOK.
$ source ~/.bash_profile
$ which flutter
5. flutter doctor
開発環境の状態を確認してくれます。
$ flutter doctor
以下、実行結果。
XcodeやAndroid Studio、VS Codeなどの開発ツールの状態を見てくれます。
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.4 19E287, locale ja-JP)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that
location.
You may also want to add it to your PATH environment variable.
[✗] 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
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds
to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[!] Android Studio (not installed)
[!] VS Code (version 1.44.2)
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[!] Connected device
! No devices available
! Doctor found issues in 5 categories.
