How to run Flutter app on real device - Solving VS Code no device problem

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to flatter teacher most of our viewers and subscribers have asked me for explaining how to run flutter application in a real device so in this video I will explain a running application in a real device using vs code along with that I will explain different problems and solution involved with the use of real device so without wasting time let's get started [Music] let's open the views code and you can see at the bottom right corner of your code it is showing the selected device so tap on this specific device now vs code is showing you three different devices that has detected by it so first one is a chrome then the age and the windows here you can see it haven't selected my real device this is because I haven't connected my phone yet in the laptop so let me take my cable here and let me attach here to my computer so I have attached here you can see immediately it has detected and you can see the magic now vs code has detected my device here now it is showing the four different devices here you can see this specific ISO is here it is a device which means it's my real phone which I want to use to run that application so I need to tap on this option so make sure that whatever device or whatever phone which is selected in Vios code at the bottom right side only in that specific device your application is going to run when you tap on this run button or run option for example let's say if I click here say if I click on the Chrome here and now when I run application so it is going to run application in a chrome and not inside your real device so make sure you should tap on the real device here and you should run application here so let me run the application here and now let me uh just mirror my first screen or phone screen using this crap please let me just open the scrap here I have already created a video for using this crap using a wire using the Wi-Fi also so if you want to get more details about that Scrappy so I request you guys to go ahead and watch those videos related to Scrappy up so this is what you process that allows us to run a flatter application in a real device now let's talk about different types of problems that we are going to face while working with the real device and what are the different solutions for that now the first problem that we usually see that when you open a vs code you will find that vs code will detect different devices but it won't detect your specific phone you can see here my vs code has detected Google Chrome age and the windows but it haven't detected my real phone so even if you connect your phone vs code is not going to detect your phone but it will detect the Google Chrome Edge and windows so let's talk about uh the different reasons for this problem and how we can solve this problem the first and the biggest reason behind this problem is not enabling the USB debugging in your phone so being a flutter developer it is essential that we should go inside a setting of device and we should enable that USB working so how to do that one I will explain in brief for this we have to tap on the settings icon of your phone then scroll down at the end you'll find option coin system once you tap on system you will find this about phone app on this about phone go to scroll at the end and you will find option called build number we're going to tap on this build number seven times so as I am already developed by it is showing me a message that no need to you are already a developer so let's click on the back button once you click on the back you will find option called Advanced app on this Advanced and you will find option called developers option tap on this developer option scroll down a little bit you will find option called this USB debuggy so make sure that you should turn on this USB debugging and you should turn on this developer mode the place where I have find these developer mode my systems option and all this then and the build number it might be different in different types of phones so as I'm using the stock Android that comes with this Asus phone so this is the place where I'm getting all the settings but based on different phones or different companies that you have so place of net specific uh about phone and the build number might vary so you have to search for your specific phone and once you enable that specific developer mode so make sure that you should do all the settings properly according to your phone you might have a question that you have enabled your USB debug properly still your vs code is not detecting your real phone so there are chances that you might be using a quality USB cable so how to detect whether you have proper USB keyword or not simply connect your phone with your laptop or computer and now if your phone is being detected by your operating system that is inside this pcrs Explorer then you can say that your USB cable is proper and it is working in a good condition you might have an expression that you have properly connected your phone with USB cable and that is working completely fine your phone has been detected in your computer or laptop still your us code has not detected your device the reason for that one is the wrong choice of your USB preferences whenever we connect the phone with laptop or computer in some phones it will ask you you will be previous so make sure that whenever you connect your phone you have to select option called file transfer and not option like charging or say MD or any other options now you might have a question you have properly enabled your USB debugging your cable is working properly even you have selected proper USB preference still your vs code haven't detected your device so the reason for that one might be in your flutter installation or flutter setup so for this purpose we have to open the command prompt and we have to hit the command called flatterdoctor if your flutter doctor is giving error like say for example unable to locate Android SDK or your Android SD is not found here or you might have problems like say command line component tool is missing our Android license status is unknown so for all these flooded after issues I recommend you guys to go ahead and watch the video called install button which is available in this channel link is also there in the description so this video has the steps that you have to follow in order to install flutter properly let's talk about another kind of problem called No device when you open a Vios code at the bottom right side corner of your score it will show you the option called No device it means vs code is not detecting any device here not your real device and not the built-in devices like say Google Chrome is or the windows in your system let's understand reason for that one the reason for that one is invalid flutter setup so for this purpose open the flutter doctor means open the command prompt and run the command called photo Doppler make sure that your fluttered octave will show that flutter installed properly so that you you don't have any problem with Android license or Android tool chains or your Android path or any issues so everything has to be properly here and you should have your views code installed properly and now one important thing is if you are running means if you are planning to run your flutter in Windows then only this Visual Studio is important for you so if you are not thinking about executing your flutter for Windows then you can skip this particular part for your Visual Studio even though if you skip that one or if it is having a problem your flutter is going to work one more thing that we can try is to uninstall this Dart and flutter extension in your vs code and we have to reinstall that one after reinstalling make sure that you should close your views code and restart that one so there are chances that we use code will detect your device might be a real device or maybe the list of uh all the building devices in your system
Info
Channel: Flutter Teacher
Views: 75,098
Rating: undefined out of 5
Keywords: flutter real device, run flutter app on real device, flutter mirror real device, flutter unable to locate device, flutter run app on real device, run flutter app on android mobile phone, run flutter on actual device, how to run flutter app on real device, how to connect real device in vscode, run flutter app on real device vscode, no device in vscode, vs code not detecting device, flutter vscode real device, flutter doctor error, android toolchain flutter error
Id: yxif9Tj8fDE
Channel Id: undefined
Length: 7min 12sec (432 seconds)
Published: Fri Jan 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.