Develop iOS Apps Without a Mac, on Windows with Xamarin Hot Restart

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what if i told you that you could develop an ios app without ever having to own a mac wondering how to do it you only need a physical ios device a windows machine and a cable to connect the two let's find out how to do it but wait before we go any further i need to thank alessandro simonelli and i don't know why this comes out with an italian accent because kind of like the name sounds italian but please alessandro let me know where you're from because i'm very curious to know alessandro is my latest member in this channel because you can join this channel as a member and it has two tiers junior developer senior developer and as a senior developer you also get a little shout out in my video so here we are thank you so much to all of my members who are supporting me with a small fee a month during this adventure and pay for all this expensive studio equipment amongst other things um thank you so much for that if you are considering yourself dear viewer to become a member and support me a little bit giving back for all the content that i'm putting out there for you please click that join button and check out what it's all about now quickly on to the main event of today building ios apps on a windows machine [Music] so first let's talk a little bit about what xamarin hot restart is um exactly so xamarin hot restart enables you to quickly test changes to your app during development including multi-file code and its resources and references so if you know now about net hot reload this takes it a step further because this also allows you to add resources or add new images that you can use straight away or add new references that you can use straight away which is really cool but this is very limited well very limited it is limited to a certain scenario for now it is very limited to well it says here visual studio 2019 but this also works in visual studio 2022 as i'm about to show you um and it supports ios apps only using xamarin forms so kind of like the only scenario where you can use this is examined forms when building ios apps what it doesn't say here is that you can also use this to develop your ios apps using just a physical device ios device a cable and a windows machine and i left out one little thing you also need a paid apple developer account but that you need anyway if you want to take your app to the store at some point right so that's also what's listed here the requirements visual this is just the software requirements i see visual studio 2019 or higher itunes we'll see about that in a little bit and an apple developer account and paid apple developer program enrollment now that is everything you need and here you can see initial setup you need to enable this under preview features technically this is still listed as a preview feature but it works just fine and i wouldn't be surprised if this is turned on by default by now and this docs might be a little bit outdated now let's just quickly switch over to visual studio 2022 and see how all of this works so here we are in visual studio 2022 and i just created a file new xamarin forms application you can see it here in example this is just a template that you will get out of the box nothing fancy here but what you can see is that i set the configuration here at the top to debug and iphone so i only have the ios project in here we go over to our solution explorer i have the shared project here at the top which is your exam reforms project that's where you want to have your code and i have the ios target here with all the ios specific bits now typically if you start a project you can also have the android and uwp projects in here i left them all out i'm just focusing on the ios one right now which allows me to set the debug configuration right here and also the iphone configuration and then it says local device so make sure that you set it to the local device also of course we have possibilities to do it with a remote device or through a simulator which will connect over the network to a mac but we're going to use the local device again i'm just plugging in this cable into a windows machine there is no mac in the network right here you can see it's not connected typically whenever you have the mac connected you can see here it's paired to a mac this is not set up this is not working right now so if i set this to local device and i just press the run button it will come up with a wizard that will help me set up the hot restart here we are set up hot restart and this wizard will guide you through the process of setting up deploying to a local ios device so there's something interesting here this feature is designed to be used during app development and will not allow you to publish your app don't worry about that make sure to watch the whole video i will answer a little bit about that as well how you can overcome that problem so okay this is all fine let's click next install itunes i haven't set that up here is a little note about how to set it up why you need it etc etc i think you need it because it will give you some libraries it will give you some apis that are used to connect to your ios device on windows and those are used to then deploy your app to that device and run all the things from there so you need to set it up let me do that a little bit quickly so there was will be a little edit cut in the video here um i will go over this really really quickly i assume that you can download and install itunes by yourself so let's just quick uh quickly skip over this and go to the next step okay so itunes is installed i've done that through the microsoft store you can just find it there and when i close this we should be able back here and you can see that this wizard now picked up in itunes has been successfully installed it will automatically see that so we never have to leave this wizard right here we can just wait for itunes to install and then we can click next now it's waiting for an ios device to be connected now here is where it got a little bit funky for me when i try to prepare this demo um so i have this ios device right here look it turns on i have a cable i had it already connected let me disconnect and connect it again it you can see here at the corner well actually not because i'm in the way you can see that it picks up on my iphone so it sees it's here but what i actually needed to do is start itunes to actually let it pick up on this phone so let me see this is not going to be the most polished demo that you will ever see but let's go over into itunes and let's see if we can get this device to show up there so it probably has to do with the license agreement let's agree to that and then we have to disconnect and connect our device and it has to show up in kind of like itunes so also here agree to this which is fine let me move this to the side a little bit can i do that itunes no you're not going to let me okay that's cool because it's just hanging in general um itunes is well i never really liked itunes but itunes is you know apple made it necessary to do it on windows but it never really has been great okay it seems to be responsive now so let me just disconnect and connect this again and hopefully this will just show up here do you want to allow this computer to access yes continue we might want to set up something here on this device as well you can see it has this little dialog which asks me to trust this device let me trust it you shouldn't have to log in with like oh i see a little icon here you shouldn't have to log in with your account or whatnot so welcome to your new iphone because this is a test device so this is set up as a rather new device sync with itunes get started which is fine okay here you can see all the numbers of my iphone so i assume that is connected by now and you can see again that the wizard has picked up on that so a device has been connected please continue you can see it's called iphone let's click next and now you have to log in with your apple id so let me just quickly do that which is here we are and whoops made a little typo there and add my password here all right let's click next and it's going to sync my apple device developer info you can see this comes up with a little mac pop-up dialog because i'm using remote desktop into this windows machine so that's why this pop-up comes up which is in this case pretty handy because i have two factor authentication set up of course so let's do allow you can see this little code coming in here and i can just enter this code and you can see that it will then authenticate me so that's verified let's do this syncing developer teams okay and now it's logged in so you can see it syncs the teams and here is the teams that are configured for my account and you can select the the team that you want to use to do this ios development so i'm going to click this one here it's going to create some certificates it's going to do some things in the background you can see it's very busy you have to wait and now boom automatic provisioning completed successfully and now everything is ready for my app to run from windows on my ios device so let's click finish here and you can see that here at the top it went very fast it went to iphone from local device now the build is successful um you have to have your device unlocked actually i have to redo this again it's deploying into device iphone so it's just building the final new xamarin forms application and it should show up on my physical device here it might take a little while the first time but the really cool thing is is that you can develop your application while it's actually running and that is the the real power of hot restart so you can now add all these things um oh i need to launch the application manually so here's a little icon and whenever i do you can see that um there comes my xamarin forms app running on a physical ios device through visual studio now also the the hot restart hot reload things just work so if i change the the big blue color bar to red right here you can see that that automatically pops up it should whenever we change that maybe i need to save the file here and it should here you go it goes to red now let's make it green just so you can see that there are actually changes going on so green let's do that let's make sure that this doesn't go to sleep save my changes and it changes to green now this is just the color of course but you can change all the things you want and this is literally just a ios device connected to a windows machine running a ios app so how cool is that so you probably have mainly two maybe three maybe a lot more questions right now but i'm going to try and answer a couple of those that are on the top of my mind so the first one is will this also work for a don at maui application at this time so the answer right now is no i couldn't get it to run in visual studio 2022 with a.net maui project it seems to go a far a long way because it sees my apple device it sees my all the things the designing the certificates it seems to almost work so i'm not sure if this is due to something in hot restart or maybe the fact that we are not able to deploy down at bowie applications to physical devices yet i'm not really sure but hopefully in the future we will be able to use this now the other one is is this functionality going to come to like visual studio for mac or maybe other ways or maybe to android as well because this is not just about like running ios apps on a windows machine right so because the functionality is actually about being able to basically create your whole app add resources add references add all the things without having to restart your application so that would be coming uh very handy for android or all the other platforms and on visual studio for mac as well so on the docs page that i showed earlier it said that that is on the roadmap so i hope that's not outdated and it's still on the roadmap and it's still something that's going to be developed now the last thing is probably the big one that you're asking like the thing that i mentioned in the beginning i can't run this app this debug build on the app store if i want to provide something to the app store i'm going to still need to compile on a mac now that is kind of an easy one to get around because you have free hosted mac machines on azure devops or on app center and there's probably other solutions that kind of offer this as well you can even do a solution like mac in cloud which allows you to rent a mac machine somewhere in the cloud you could send your code to there you can do the little compilation and you only need to do that last compilation that you're going to send to the app store you have to do on a physical mac machine so if you set up your ci cd pipeline on azure devops you can do that for free i think for 240 build minutes each month and you do all the development on your windows machine you push your code to the repository it starts building on your ci pipeline and it automatically pushes from there to the app store which is completely legitimate it works you can do it and that is how you're able to develop a ios app only through windows and a physical ios device isn't that mind-blowing um thank you so much again for watching one of my videos if you've liked this one please click that like button so more people can join in on this fun and can stop buying expensive mac machines to actually develop their ios applications if you like this channel if you've seen a couple of videos now and you think like that gerald that seemed like a really nice guy who knows this stuff please subscribe to my channel so that i will pop up in your feed automatically and you don't have to come searching for me other than that i only of course have to say only one thing keep coding
Info
Channel: Gerald Versluis
Views: 5,007
Rating: undefined out of 5
Keywords: hot restart, ios development, xamarin tutorial, visual studio, xamarin forms, mobile apps, develop ios apps on windows, develop ios app without mac, develop ios without mac, develop ios on windows, visual studio 2019, visual studio 2022, Xamarin Hot Restart, Xamarin Hot Restart iOS, Xamarin.Forms, xamarin forms app, xamarin.forms 101, xamarin.forms tutorial, Xamarin Forms 5, xamarin tutorial for beginners, xamarin forms 5.0, visual studio 2022 new features
Id: tJUcBQ07jSc
Channel Id: undefined
Length: 14min 2sec (842 seconds)
Published: Mon Dec 06 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.