Reputation: 12590
Flutter 3.0 is amazing !!
I can make a web app, android & iOS mobile app, and a native Mac app (and more) all from the one code base.
But now my problem is : How do I specify which OS to build-for and run-on ?
When I do flutter run
or debug>run in VSCode it will build-for, and run-on, my Android device first if it plugged in, or else as a Mac app. I want to run it as Web. More generally, I want to specify which OS I want to build and run for.
Both the flutter run
command line option, and the VSCode setting (preferably without messing about with launch.json
, or else making that seem easy).
Upvotes: 1
Views: 217
Reputation: 100
It depends on the selected device. If you select an Android Device, it will build for Android OS. If you select a browser then it will run the build on your Default Browser and the same goes for other scenarios.
Upvotes: 0
Reputation: 17772
You can use
flutter run -d chrome
For running it on chrome
flutter run -d your_device
For mobile device
Upvotes: 0