Build iOS Apps with or WITHOUT a Mac? Visual Studio, C#, & .NET MAUI with Hot Restart

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
oh oh hello I didn't see you there oh so you've been looking to to build and deploy an iOS application from Windows using dynamally well I got you covered whether you have a Mac or you don't there are multiple ways to deploy and build iOS applications directly from Windows all over your network or directly to your iOS device and today I'm going to break down every single thing that you need to know so tune in [Music] foreign [Music] I'm James and I'm back today to talk about a problem that I've sort of skimmed over a little bit in some of my earlier videos which is how do you actually build and deploy an iOS application using Don and Maui you know to a device or to a simulator if you're on a Windows machine maybe you don't even have a Mac how do you do that development process well if you watch any of my getting started or tutorials you saw that I talked about a few different pieces of technology that either enable you to connect to a Mac or directly plug in your iOS device into windows and I'm going to break down those two different ways of the building and deploying iOS applications today now the first one is a try trusted and true method of building iOS applications from Windows which is pairing directly to a Mac on your network such as my MacBook Air right here now what this enables you to do is to do a remote build and a remote deployment and the iOS simulator will show up either on your Mac or you have the remoted iOS simulator to show it up on your Windows device as well which is actually really really cool so let's go ahead and take a look at how to get this set up automatically from Windows and visual studio 2022. all right the first thing that we need to do is have our project open here I am I'm just inside of a brand new.net Maui application and there's a few ways to get the pairing working the first one I always go to is just this little pair to Mac button but you can also do iOS over here pair to Max a little bit off screen but it's definitely there trust me when you tap on that it's going to bring up this little dialog now if it's your very first time you're going to see this how to pair to your Mac instruction guide now what this will show you is that you need to go over to your Mac and you need to enable remote login this is essentially going to enable your Windows machine to connect to your Mac over SSH let me turn on remote login you give it the specific usernames that you want and you're off to the raises now inside of this pair to Max screen this is either hopefully going to find your Mac automatically like it has here my MacBook Air with my IP address and that's using the bonjour service so you might see a bunch of odd things inside of there hopefully adjust your Macs but maybe some other Appley devices or non-apply devices sometimes are just broadcasting there which is cool or you can go in and say add Mac and then you can go ahead and add the IP address manually so I'm just going to go ahead and double tap on this Mac it's going to connect via SSH I'm just going to go ahead and enter my username and password now this is the username and password of my Mac so when I went over to my Mac and I have remote login plugged in then it was all set up now this is the same process that works specifically back in the xamarin day so when you're doing xamarin iOS or xamarin forms development this is the exact same thing essentially what's going to happen here is going to go and it's going to check to make sure you have the right version of um the SDK install the right versions of the iOS SDK and everything that you want so here we can see that's actually installing the.net SDK it's going to do a bunch of other stuff so let's give it a few seconds here to get through doing this because if you have the same build on the same version it's going to be pretty quick but if you have different versions it's going to install a bunch of stuff so I'll give it a few seconds here all right we're totally all connected we see that little chain link there that means we're totally good to go we can see up here that it's paired to my Mac and it has a little green icon here all right now all we need to do is simply select our iOS device there's a few ways of doing this let me just make this a little bit smaller here so from our drop down we're going to see that there are three options a local device talk about that in a second remote devices Remote device is if you have an iOS device set up on your Mac so it's actually plugged into your Mac it's a Remote device you can also set it up inside of xcode to be a wireless device you could actually just have this basically Wireless to your Mac and then deployed wirelessly here which is kind of cool you can see my my Apple TV I think is set up there then there's the iOS simulators so as long as you have the correct versions of xcode installed and everything's up and running you're gonna have your iOS simulators there you do need of course xcode installed on your Mac just as you would expect you know alongside your visual studio for Mac as well and this is going to have all the different devices here so let's pick one like the iPhone SE 3rd gen I'm just gonna go ahead and snap this here and I'm going to hit run what this is going to do now is compile up my application and then it's going to go ahead and deploy it to a remote iOS simulator now there are two options remote iOS simulator or just a normal iOS simulator when you go to tools options you're going to see here under xamarin iOS settings you have cylinder xamarin because it shares the settings with the xamarin iOS here we can see that you can pair to Mac which is the same screen enable auto connections to known Mac so if you want it every single time you open it up you're good to go down here you're going to have the remote iOS simulator checkbox and then this is pretty important this is where you can update your version of xcode I use an app called xcodes which I've done a video on I'll put it up over there to manage multiple versions of xcode and here I'm running 14.1 for example so this is going to go ahead and compile up my code basically what it's doing is a remote compilation of all my source code and it's going to compile it up into an executable to be deployed onto the iOS simulator so let's give it a few seconds here and we'll be Off to the Races all right we are deploying now and now we have this little iOS simulator here which again is basically going to start up an iOS simulator on my Mac which is kind of bananas and then it's going to go ahead and display it here on my Windows machine and this is kind of bananas because if you do have a touch screen it's going to actually have all your touch screen stuff like that there are different settings here for screenshots rotation gesture shake and a bunch more but there it is there's like literally an iOS device on my Windows machine I don't know how cool is that uh that's pretty bananas in my opinion you can scale to fit you can do a bunch of other things like that and of course you get full debug support as well so it's going to use your Yamaha reload hot you know reload all those other things as well and of course this is just the default application so it's just going to have the button clickers down here for me so again it's going to go ahead and load up all the assemblies for the first time it's happening on my Mac so it does take a few seconds here as it loads everything up and then actually see it in real time which is great Yamaha reloading initializing so cool and then boom there it is and I can click click click I can of course come into my solution Explorer go into my main page I do get my xaml live preview up and running which is very very cool I can add break points over here and then I can go ahead and tap on that breakpoint I can inspect variables everything that I would expect I could do right I mean that's what you would sort of expect for it to be doing and now we have our iOS application running here and again inside of the xamlife preview as well which is super duper cool foreign true and tested way like I said earlier of doing it because you're doing that Full Compilation so this is nice uh if for example you have a lot of dependencies that are using native libraries you need access to a Full Compilation maybe you're using a health kit or something else like that that needs different entitlements you're going to need to go through that full process of connecting up and going off to your Mac and doing those things like that what if you're just getting started or what if you're like me and a lot of my applications aren't that crazy complicated I'm not using tons and tons of native underlying hood you know libraries that need to be compiled what if you just want to not have your Mac and you want to I don't know put it on your iPhone you know you just have an iPhone an iPad iPod touch if you still have one sitting around probably a newer iPhone or newer iPad would be ideal what if you just want to take this and then deploy it over into your from your Windows machine but you can do that let's take a look before we go any further I have to tell you about our partner this week skillshare now you may know skillshare for their classes on photography film illustration and more but did you know that they have hundreds of career focused classes too and that was really the perfect time to reinvent your goals and yourself and explore your passions now let me tell you a few ways I've been personally utilizing skillshare ever since I joined first is actually a class from MKBHD on content creation and YouTube success that I've been applying to this Channel and other content that I do now personally if you're like me you may have a lot going on but that doesn't mean that you can't take more time for things that fulfill you and personally I've loved the classes around productivity and time management Ali abdal has a delightful master class on productivity that showed me the best habits and tools to help boost productivity and he also has a class that blew my mind on how to actually use notion which is something I've always want to to use to help organize my life there is something for everyone on skillshare with endless opportunities to learn how to design a career that fits you and I'm really excited to partner with them to give away a free one-month trial to the first 1 000 people that use the link in my description below that's right the first 1000 people will get one month free trial to skillshare all you have to do is use the link below in the description and thanks to skillshare for partnering with me for this video all right so this piece of technology is called iOS hot restart again this is under Tools Options under the iOS settings and down here is the hot restart it's not my favorite name but basically what it does is it uses The Interpreter to be able to run your app inside of a app shell basically um that can be deployed onto your device which is nice from your Windows machine with no Mac at all now there is some guides and documentation here the one caveat here is that you need to have a you know a 64-bit local iOS device vs1922 you do not need to pair to a Mac Bill to us in fact I'll disconnect just to prove it to you and the other thing here is you're going to need to install iTunes from the Microsoft store or the 64-bit version on your machine and you need to have an apple developer account and be enrolled in the paid Apple developer program that is a lot of requirements but if you have all these things you're totally good to go now the reason for this is because iOS to deploy to devices requires Apple developer accounts certs and certificates and all these things so that's how you're going to need to actually be able to get it onto your device here which is really really cool all right so once we're good I'm going to go ahead and and go ahead and disconnect from my Mac so there we go and now we can see that I have no simulators nothing on here at all and and again no local devices so what I'm going to do is take my iOS device and I've plugged it in and I'm going to plug it into my machine now you might need to go ahead and make sure if you get a pop-up that says hey you know do you trust this device make sure you trust it again make sure you have all those dependencies installed and everything like that and once you have that you should see under the iOS local devices your device and here is my iPhone 11 Pro so I'm going to tap on that and again that's under the local devices because it's local to this machine all right now that I have my iOS device selected all I need to do is hit debug now if this is my very first time building and deploying this project I'm going to get this little pop-up here which is setting up hot restart now if I don't have iTunes installed and I don't have my Apple developer account installed then I'm gonna walk through that process here but I already have it which is nice so all I need to do is come in and select my team now I'm going to show you how you set this all up and the documentation is great and what you'll do is create an API key in the Apple developer portal and plug it into Visual Studio I'm going to select my team this is going to go through make sure all the provision profiles everything is synchronized and good to go and I can hit finish all right and just like that we can see now it's deploying the application to my device now it's going to pop up this little message here that says for the first time I need to actually click on it which I'm going to click here we can see the.net Maui application opening and launching from my device directly from Visual Studio directly wired through USB to my desktop here and of course I can be any Windows machine such as my service laptop over here which I use all the time on the road and now we have our hello world over here and boom just like that we actually have it showing up inside of visual studio in that xamlife preview as well so I can click that I can get my xaml reload I can get my C Sharp hot reload all that goodness that I would expect which is pretty amazing foreign we did it now there is quite a lot in there now I've gone through the Hoops sometimes you have to revoke different provisioning profile certificates you've been doing this for a while you might get some error messages in your setup but if you're coming in fresh and you're setting up these accounts for the first time you're going to be good to go uh as these things sort of progress the setup's gotten easier and there's all sorts of good stuff in fact I want to show you really quick the guide over here so the guide walks you through this process so notice here there's more steps like iTunes hot restart all this other stuff and this will actually walk you through signing in with an Enterprise or individual account so here you set up your auth key your p8 key all the stuff and it shows you how to create it inside of the App Store connect as well so all sorts of good stuff there so really really easy to do it looks a little bit you know complicated but you know in general it's it's a nice walk through for everything that you need like I said if you've been doing this for a while and you have some old cert sitting around make sure you clear it out make sure you read any error messages that may come up but for me it's been a really relatively smooth process using these new API Keys getting anything everything up and running now a few caveats of hot restart you may notice that by default if you change your app icon the app icon is still the.net icon you're like oh that's weird same with the splash screen well that's because um it's running your source code inside of an app shell right so it's not your actual app deployed it's an app inside of an app so it's really only for development purposes when you want to go off and actually build and compile and deploy your application to the app store then you're gonna need a Mac or a cloud host solution or something like that now if you don't have a Mac sitting around there are some options obviously I'll be like GitHub actions Azure devops App Center bitrise all these different Cloud CI services but there is actually Mac and Cloud which lets you rent out a Mac in the cloud basically it's been around forever and it has like visual studio for mac and all that stuff set up as well so there's lots of options there which is really really neat but I kind of want to walk through these different things whether you pair to your Mac get everything up and running yet iOS hot restart running all those things let me know what you think if you've got everything up and running and deploying onto your devices or onto remoted iOS simulator let me know what your setups like in the comments below and other things that you might want to see from videos here on these different setups and guides so you can be super successful building.net Maui applications if you made it this far in the video you are the best and I'd love it if you could hit that like button down there and jam subscribe as well so you stay up to date with all the videos that I'm putting here on my channel that's gonna do for this video until next time thanks so much [Music] foreign [Music]
Info
Channel: James Montemagno
Views: 56,586
Rating: undefined out of 5
Keywords: .net maui, dotnet maui, dotnet maui tutorial, .net maui app, learn .net maui, .net maui tutorial, .net maui getting started, dotnet maui getting started, .net maui crash course, maui, xamarin, learn dotnet maui, .net maui overview, ios hot restart, visual studio ios, ios visual studio, deploy ios visual studio, xamarin.ios, xamarin ios app visual studio, xamarin forms, dotnetmaui, net maui, c# maui, .net 6 maui, visual studio 2022
Id: snQ1C6Cppr8
Channel Id: undefined
Length: 16min 35sec (995 seconds)
Published: Thu Jan 26 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.