こちらは、ほぼ この 記事の通りの内容です。
以前の Flutter開発環境の構築 の続きになります。
コマンドラインからFlutter appを新規作成します
flutter create my_app
シミュレータで実行します
cd my_app flutter run
とおもったら以下のようなメッセージが表示されうまく起動してくれません。
No connected devices. Run 'flutter emulators' to list and start any available device emulators. If you expected your device to be detected, please run "flutter doctor" to diagnose potential issues, or visit https://flutter.dev/setup/ for troubleshooting tips.
デバイスにつながってないよーという感じなので、 事前にシミュレータを起動しておく必要がありそうです。
コマンドでシミュレータを起動する
open -a Simulator
再度シミュレータで実行する
flutter run
以下のようなメッセージが表示され、 エミュレータでサンプルアプリケーションが実行されます
🔥 To hot reload changes while running, press "r". To hot restart (and rebuild state), press "R". An Observatory debugger and profiler on iPhone Xʀ is available at: http://127.0.0.1:65356/p50We9onbd8=/ For a more detailed help message, press "h". To detach, press "d"; to quit, press "q".
サンプルのアプリケーションは、 +
ボタンを押すたびに画面上の数字が増えていきます。
おまけ : dartのインストールを忘れていたので今更実行
brew tap dart-lang/dart brew install dart