I tried to make my project run on Web
so I typed this command
flutter run -d chrome
But it always runs on chrome when i typed
flutter run
, I would like to switch to run on android emulator How to switch to run android emulator?? Thank you very much
CodePudding user response:
check device Id by running
adb devices
then run with deviceId
flutter run -d yourDeviceId
Let me know any issues you find in comments
CodePudding user response:
If you're using Visual Studio Code, you can select the device your app should run on the bottom-right and then, run the app by pressing CTRL F5(F5 to run it with debugging) or from the top-right.
Your preferred device is Chrome(web-javascript), right now. You may need to go in main.dart to run the app, it is a VSCode bug.
Otherwise, you can run the command: flutter emulators --launch <device_name>
and flutter run
.