How to `flutter run` with target device as android?

Issue

I have my flutter app built and running on macOS using the following command.

flutter run

This is great.
Now, I want to run my app on an Android device. It has developer mode enabled and getting recognised when I run adb devices. I have also run other apps on my Android device. So, I am sure the android device is well set for android development.

But now when execute flutter run, my app still runs on macOS instead of Android device. I did a flutter build apk which built my app for android. But, flutter run still runs on Mac instead of Android.

Isn’t there a flutter run command to run the build on Android specifically?

Solution

flutter -v -d your_android_device run selects the target device to run on.

Answered By – TheWaterProgrammer

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *