How do I run my flutter program on the Android emulator ? Because when it runs the program can only run on Chrome

Viewed 1700

I installed the flutter and dart plugins on Android Studio, already installed SDK and AVD for the Android emulator. But the program still runs on chrome

3 Answers

Launch your Android emulator, run flutter devices to get the id of the emulator device. Then, you can run flutter run -d [emulator_id] to launch the Flutter application on the targeted device.

If you are using VS Code, you can select the target device by using the status bar changer:

enter image description here

That will open up the list of connected devices in the command palette you can pick from.

enter image description here

To see available emulators run this command:

flutter emulators

Then copy the name of emulator from there and enter this command:

flutter emulators --launch EmulatorNameHere

Now when the emulator ready and running:

flutter run
Related