Hello, in this video, I am going to show you how to set up a flutter project or set up flutter to create projects on your Mac for running on iOS, if you're interested on, you know, setting you up for into a black and white line at all windows, I've got videos covering that. I'm also going to video covering different set of flutter on Mac for Android. So you can do maybe iOS and Android development at the same time, then, you know, check out that video. You can do iOS and Android and check this video and that video. Okay, so the first thing that you need to do, I'm sure you've already got it, but install Xcode, you can get this from the App Store. So if you just download the apps, I mean, if you open up the app store, and you search for Xcode an hour ago installed, download it, install it, install the simulating, notice, get all of that stuff done.
Once you've done that That's like a prerequisite. Once you've done that, what you want to do is launch up a web browser, and literally Google flutter. I'll provide links to all of this. So you can, you know, not have to type it out yourself and go to flippa.io. Go to get started MCO s and just click this, this will download the flutter zip file. I'm going to cancel it, you don't need to cancel it.
I'm doing it cuz I've already got it downloaded. Now, what we want to do is open it up. So it's right here. If you double click it, it will unzip. And if we just wait for it to on zip this, this framework, and then we'll you know, proceed with the next step. Okay, so that's, you know, unzip this, I recommend copying this folder, go into applications create a folder called development in all your all of your development frameworks right in here and paste it here.
I've already got it pasted, so I'm not going to paste it again, but it's pasted here. So you got it like so flutter. Now what you want to do is set up flutter. So it's linked with your, essentially your system PATH variable, which means when you open up terminal, you can access flutter without having to always navigate to this directory. If you look, there's not no file here. And we can run this so we could see the to this directory in our terminal unit, but that's not very good.
If we want to run through attack, we have to always change directory to this folder. So what we're going to do is essentially, you know, add it to our path. To do that. It is pretty simple. You open up terminal and the time you know what you want to do is We need to fucking CD and put the tilde forward slash. This will take us back to our home folder if you're not already in there, but by default it should be.
Now you want to type in touch dot bash, underscore football. So what this does, it creates a file called dot bash profile. If it doesn't already exist in your home directory it does for me and as you see when I open it'll already be some you know lines of you know command in there, your room most likely be empty but that's just because employment is a new file for you. Click enter that created it now we need to open it we can open it by doing open a dot bash, underscore profile. This opens it in TextEdit. And looks at all of this was added before I added this just before the video but this is essentially what we need to add.
So What I want you to do is I want to get rid of this, I want you to add this into the export space path. all uppercase equals quotation marks, dollar path, all uppercase colon, quotation mark. But before that a closing quotation mark here is where we need to put this bin folder. So if you literally drag this over here, you'll get it path, yours will most likely look different to me mine that the quotation marks should be there, sorry, you're gonna look most likely slightly different to mine. Or it might it might not it might be the exact same path. Save that, close it and now we just need to essentially, you know, you know, committed to do data source dot bash, underscore profile.
Now if we want to do open, as you can see is right, yeah, so that's what we want to do now. If we were to run to love, Turkmen love to doctor This is essentially just analyze the essentially the installation the setup for flutter. And let us know if there's anything wrong, yours will look slightly different, you'll most likely have more, you know, errors and crosses and I'm going to explain them in a moment. Okay, so this should be ticked for you if the previous step that we just did was successful. If you have a problem at any part of this video, feel free to put me in method, this step doesn't matter. This video will cover in the in a separate Android setup video for Mac.
Same for this one, this is irrelevant unless you absolutely want to use IntelliJ. that's optional, you know for iOS or Android doesn't really matter. I've got no device connected, you can connect the device, you know set it up by Xcode using the provisioning profile as you normally would for any iOS app development, where we are going to be using the simulator that is still consider a device like this not open. Hence why this is essentially giving us a warning. But this isn't significant. This is the one I'm interested in for me, it's ticked for you most likely don't have across Not only that, it's gonna be moaning about a whole bunch of different things about installing this by installing that.
And that's what we are going to cover right now. So to essentially set all of that up, really simple. First of all, if you go to your web browser again, and Google homebrew, and then go to brew.sh, and I'm going to copy this. I'm going to copy all of this. Copy that. And this is the package manager that allows you to install frameworks and packages in Terminal really easily.
Open up terminal, and if we right click, paste in here, this is where you would click enter. I'm not going to click on tags. I've already got it installed. So you would click enter at that point. So let me just delete this, it will take a little bit of time, if you ask for your password, put the password in, you might need that to install something. Also, the password will not appear in Terminal.
So when you type in, it is actually been, you know, no input. So don't worry about that. Once that's installed, and it's all successful. What you want to do is type in brew update, brew is the command for homebrew and this will just update homebrew most likely should be already up to date but if not, maybe you have an older version or you install it then go away for maybe a day or two, the new version released but this is what you need to do. Then you want to run the command through install dash dash USB USB McStay. Again, yours is going to take longer than this and you will not get this warning because I've already got it installed next week.
Link, USB looks the thing you need to link it up. I'm going to get a warning because it's already linked, you will not get a warning you will have a successful linkage. Next, you need to do brew, install dash dash head lib on a mobile device. This allows you to essentially connect to you know, iPhones, iPads, that sort of stuff. Click on tap. Again, I'm going to get a warning because I've already got it in stored you most likely will not.
Next release the brew install or the voice installer iOS cocoa pods, click enter. I've already you know in store this so if you know shouldn't Do anything for me, it should just give me a warning. Again, some of these commands can take their time. So just be patient. The last thing you want to do is try to set up the disk sets of cocoa pods, and specifically, click enter. I'm not going to click enter, because it occurred to me whether you'll give me a warning or not, I'll just do the installation again, and installation took me about 10 minutes.
For this, this command will take the longest of all the commands in this video. So click enter. I'm deleting it because I've already done it. Once you've done that, you're actually already to go to create your first flutter project. Now, what we need to do is navigate using our terminal to where we want our you know flutter project created on it on the desktop on the proceeding desktop. Now I'm on the desktop.
To create a flutter project is really, really simple. All we need to do is type in letter three And then put the name of our app, it has to be all lowercase. So if I put all uppercase, or if I put an uppercase a will give me a warning, saying that it needs to be located under some of the conditions you can read here. Well, for lowercase app, for example, that will now create a folder with our project in there. So all done, almost sauce complete. And now each order, this essentially has just rechecked this, and I recommend you doing flutter doctor again, just to make sure, especially this one and this one, or ticked, if not anything, still moaning.
Maybe there's a suggestion they have a command to run, run if there is, if not, feel free to shoot me a message. Now you can run the flutter app in two ways. You can run it using this which Essentially you see the app, or you do CD and drag this folder, right? This is the more universal way and then do flutter run. And as you can see, is given an error because there's no device connected. So if I was to run the simulator, seeming you've already you know, installed it.
And the type of simulator that you want to do is totally totally up to you. You can change the device, if you want to, you can, you know, do a lot of stuff here, but it doesn't really matter. And now if I was to do flutter run, it is launching it, it has now located a device have been connected. In this case, it is the simulator. And the moment now it will run this default app. And if there were any, you know, sort of errors in your code, they will be displayed here as well.
But it's a launch. Sadly, this default application just can't hang on, we have clicked this button. Okay, what I want to do is, so to quit with this new cue, the way I want to show you is if we quit out of this. Another way to win is via Xcode. So if you open up your app folder, go to iOS, go to one dot Xcode project, so this is the Xcode project, double click that and open up the Xcode project. And now in here, you can certainly just select a emulator or an actual device itself.
If you've already got that set up, click Run. And it will, you know, build the project compile it and it will launch it up and it will launch the emulator as well. So that's the good thing about Xcode. If you don't have the emulator open or Something to do with the device. If we're able to launch it and open it, it will. Any moment now it will show our application.
And here we go. We There we go. If we click it, it picks up anytime we clicked in the griping about this, we can do a lot debugging in Xcode as well, we just created like, so to edit the code, it isn't, you know, over here, none of the code is so the way you would need to edit it is outside of Xcode. And the code is located in live main dot Dart. So all of that that you saw is produced from main dot Dart. You can open that in a text editor like sublime or, you know, even a simple text editor for more complex like Visual Studio code.
Sublime atom is totally up to you or brackets from them. That's it for this video. Like I said, there are separate videos covering the Linux and Windows setup. There's another video called rain angle setup on Mac, feel free to check that right. If you have any questions though, feel free to drop me a message and as usual, I look forward to seeing you in the next video.