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

Viewed 3574

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?

3 Answers

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

Check that your device is recognized using flutter devices (or flutter doctor -v). If so, you can specify the device id you using flutter run -d <deviceID>.

flutter -d 54XXXXXX35130ebefd38f run

Related