Xamarin Debug App On A Physical Device

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome back to my channel in this episode i'm going to demonstrate to you how you can connect your xamarin application to your physical mobile device or android device using a usb port as you can see on the right hand side i've got a physical phone right right now it's not connected to any usb the usb has not it's been disconnected and on the left hand side i do have a xamarin application so once you connect and do a proper connection you will see uh xamarin sorry the samsung phone or any of your android phone option being selected here so let me demonstrate to you how you can get started with this first and foremost of all of course you're going to have to install a usb driver by tools android and sdk manager here so once the pop-up comes up i'm going to slide this window here go to tools and make sure that under extra your google usb driver is installed after installing this driver you will have to close and restart your studio once you bring your studio up the next thing you have to do would be to uh make your phone your android phone uh compatible for development so the way to do it would be to go to settings and you have to click some things in the settings here i've got another video to demonstrate that i'll leave the link below but once you get it once you get that set up your phone set up to be a developer mode if you scroll all the way down you can see a developer option will be available right here at the bottom here so you click on this guy here developer options and that's when you know that your phone is developer options available so the next thing you have to do is to connect a usb cable uh to your android phone i'm going to go ahead and connect the usb cable here just like that and as soon as you connect to it uh a usb debugging message will come up right so let's say i'm going to click cancel for now for some reason if you don't get that pop-up you can scroll all the way down and you can toggle your usb debugging here right here so i'm going to go off and go on again and that they say allow usb debugging click ok and then you'll come up another pop-up window saying that you want to allow this computer with this fingerprint and say allow so once you allow go back to your studio here and go to the pull down and this time around you can see your phone mine's a samsung phone so i'm going to click this guy here and then go ahead and hit play on this one here so what it does right now is it's compiling and uploading the apk file or compile file to the android phone right so you can see the application is running i'm going to go ahead and stop the application and come back in here so for some reason if you still don't see this after connecting your usb and you're not prompted with your with uh with your authorization you can go ahead and toggle it if like i demonstrated just now and this will actually rejuvenate or restart your adb server okay i'm going to go ahead and cancel and simulate let's say over here one more thing i guess if you say allow debug usb debugging if you say cancel you see that usb debugging will be turned off right there so i'm going to do this here and click ok i'll show you another way to debug your usb connection like for instance right now right so looks like uh looks like there was no question being asked about the security authorization and if you go to your studio you don't see it right so the one way if you don't if you get this right go ahead and toggle again say okay here and then the second window say allow but now i'm going to just say cancel just to simulate uh authorization not given so if this is not given this way the second way to debug would be to use the adb tool itself the location of adb tool is relatively simple is a location where your sdk file is installed if you don't know where it's installed go to tools options and if you go to xamarin this main tree itself this is where your sdk android sdk is installed i'm going to copy it right and and then what i'm going to do is i'm going to open a command prompt it doesn't have to be administrator though just a regular command prompt and then in here you go to the location where the android sdk is and then you're gonna have to open another directory called platform tools and this is where that particular adk file is so if you dir a b adb not asterisk you can see an executable file is available right so that's the file you're going to run so if you want to see what devices are attached to your computer here what android devices set to your computer what you do is that you type de sri adb devices it'll give you a list of all the devices that's attached to your computer right now i've only got one uh device attached and it's unauthorized that's why i can't really i can't really see uh samsung in here that's the reason why right so so if i were to disconnect this usb cable now it's disconnected right and if i were to go ahead and run the devices you'll see there's no device attached to the computer i'm going to go ahead and connect the device again back in here now it's connected here so you can see it's asking me do you want to allow that or not right so of course when i hit allow the the studio will be able to pick it up so i'm just going to click cancel here for now and then see devices here right so i'm just going to toggle here again one more time and do a proper authorize and i'll show you what it looks like say allow and if i go here and hit devices you can see this is what it looks like if the device is attached and authorized and of course if you go to your studio here you can see samsung now right okay that's one way to do it and for some reason if you is grossly unable to get devices here saying on unauthorized and you can't see your samsung or your android device in here what you can do is you can restart that service adb service so to restart the abd service is adb kill server that's the command to the issue click enter nothing will come up in here but if you look at your phone uh the usb configuration is uh connection is restarted and asking do you want to authorize it right so if you allow now you can if you go back to your adb server on your command prompt devices you can see that device is not authorized and in here samsung is available again so and first another thing i want to say is that in here if you kill server here and for some reason you don't get this command in here mainly because the adb server is not running anymore you can actually manually start the server by typing adb start server just like that that will start your adb server and you will probably be prompted with allow usb debugging this is uh 2019 studios so the adb kill server starts by itself right so if i could cancel here if i go in here you can see devices unauthorized so if i want to restart the adb server and they'll prompt me again you say allow now and you go devices here in a few minutes a few seconds you can see the device attached to it and you can start debugging again you run the around the xamarin application you can see that the uh the android is actually running the application here so that's a a very high level a quick way to show you how we can set up and connect i know the video went a bit too long i hope it's helpful if it does please subscribe and like other than that have a good day bye now
Info
Channel: Rabi Gurung
Views: 23,537
Rating: undefined out of 5
Keywords: Xamarin, Microsoft Visual Studio, Xamarin app, Android emulator, adb, USB, Setting, Android, physical Android device, Android device, Set Up Device for Development, Debug on an Android device, Xamarin Debug A Real Smartphone On USB On Windows 10, How to Connect an USB Device to Xamarin, Xamarin Debugging on A Physical Device, Android Device Set Up for (Visual Studio 2019) Development, How To Turn On The Developer Options Menu On My Samsung Galaxy Device
Id: tq5pLt9O0z8
Channel Id: undefined
Length: 8min 35sec (515 seconds)
Published: Sat Jan 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.