How to run your Flutter App on Physical Android Device
In this article, we will see how we can run our app on a Physical Android Device.
Until now, you may run your apps on the emulator or we can say simulator. Now, it’s time to test your app on a physical device. So, if you have an android device, just grab it & I will walk you through all steps one by one. Follow along with me.
Step 1:
We have to enable our developer mode on our phones. Go to Settings and scroll down until you locate the about option.
Right now, I’m using Oppo Phone. Maybe on your device, the About option will be somewhere else. Anyways, open the about menu and then the version menu, and here you will see the build number right up there. Simply tap 5 times and then it will ask for your password or pin through which you unlock your phone.
After entering your password, your phone developer mode will get ON.
Now, navigate back and go to system settings and find USB Debugging and enable it. This thing will allow your phone to communicate with your computer. You have done the first step.
Step 2:
Now, connect your phone to your computer via USB & try to connect with the original cable that came with your phone because if you bought any cheap USB cable then it doesn’t allow you to transmit data through that cable. It will only charge your phone. So, keep that in mind.
After connecting, you may see a prompt that says should I trust this computer. You will check the Always allow from this computer option so that you don’t have to allow it every single time.
So, now, it’s time to go to our editor. Open vs code and see in the bottom where right now, Windows (windows-x64) is selected by default.
Click here and then at the top, you will see different devices and emulators.
Select your device name and then click on Run Tab and Start Debugging.
So, finally, our app is been built on our Physical Device. We have finally run our app on our physical android device and let me give you a bonus tip. If your computer is really slow and the emulator doesn’t run smoothly then you can test your app on a physical device, and through this way, your Computer RAM will only be used by your editor.
YouTube Video
Complete Flutter Tutorial
You can see my complete Flutter Tutorial Series on my Website: https://www.youtube.com/watch?v=EdJwOGoMgAY&list=PLMstFUjTFBs7_Rorn097UD2hCS-UCm88a