How To Deploy Flutter Application On Real Android Device

How To Deploy Flutter Application On Real Android Device

Introduction:

In this article, we will explore how to deploy Flutter application on real android device.

Prerequisite:

First thing we have to enable Developer Options in our android device. For that purpose, follow the below steps.

  • Open up Settings app on your phone, search for build number and go to the suggested location as shown below.

  • Tap on the Build Number 7 times.

  • After that you will receive a popup saying “You are now a Developer”.

  • Search for Developer Options in Settings app and go to the suggested location as shown below.

  • Make sure the Developer Options is turned on.

  • Under Developer Options, turn on USB Debugging.

  • After turning it on, you may receive a popup as shown below. Click on Ok to confirm.

  • Now we are all set to use our android device for deploying Flutter app.

Deploy Flutter Application On Android Device:

  • With USB Debugging enabled, connect android device to the computer using the cable.

  • Open up Flutter application in Visual Studio Code.

  • Open up the terminal and execute command flutter devices.

  •       flutter devices
    
  • This command shows a list of connected devices as shown below.

  • Make sure your device shows up in this list. Otherwise double check USB connection and debugging settings that we have covered in Prerequisite.

  • Execute below command to build and deploy the Flutter application on android device.

  •       flutter run
    
  • We have successfully deployed the Flutter application on real android device.

  • You can test and interact with Flutter application on real android device.

  • Or when we connect the device to computer using cable, it shows up in bottom right corner of the Visual Studio Code as shown below.

  • Go to the Run and Debug option in sidebar and click on Run and Debug button to build and deploy the Flutter application on connected device.

  • So we have two ways to deploy Flutter application to real android device.

  1. Using flutter devices and flutter run command

  2. Using Run and Debug option in sidebar.

I have also created a YouTube video regarding this topic, so if you would like to watch a video tutorial, then please go to https://youtu.be/-6nXTYyHxPI

Conclusion:

In conclusion, deploying a Flutter application on a real Android device is a straightforward process once you have enabled Developer Options and USB Debugging on your device. By following the steps outlined in this article, you can easily connect your device to your computer and use either the command line or Visual Studio Code's Run and Debug feature to build and deploy your application. This allows you to test and interact with your Flutter app in a real-world environment, ensuring it functions as expected on actual hardware. Whether you prefer using terminal commands or the integrated development environment, both methods provide a seamless way to bring your Flutter applications to life on Android devices. I hope you found the article helpful.

Happy Coding!