nano ~/.zshrcĪdd a new line to export the path of your Flutter bin directory. To update the ~/.zshrc file I use the nano editor. If you have a recent version of macOS you are probably using zsh, since starting with macOS Catalina, zsh is the default shell. If you are using Z shell (zsh) you have to edit ~/.zshrc. In case you are using Bash, edit either ~/.bash_profile or ~/.bashrc. The exact name of this file depends on the type of shell you are using. To add this path to our PATH variable, we have to update the rc file of our shell. This is the path to your Flutters bin folder, which we will need in a second. cd tools/flutter/bin pwd result: /Users/bas/tools/flutter/binĬopy the result of the pwd command. The easiest way to do this is by using the terminal to navigate into the flutter/bin folder and use the pwd command to print the current working directory. To run flutter commands in any terminal session, we have to add the Flutter SDK to our systems PATH variable.įirst, we will find the path to our Flutter bin folder. I recommend using the stable channel unless you have specific needs that are only available through more recent releases. There are four different release channels: stable, beta, dev, and master. This is okay for us because even though desktop support is still in the beta phase, it’s possible to create desktop builds on the stable branch. The last part of the git clone command, -b stable shows we want to download the stable branch. You should now see a new folder named flutter within the tools folder. Open your favorite terminal, navigate into the folder where you want to download the SDK, and clone the SDK into this folder. This article will demonstrate the latter option. You can either download the SDK, use Homebrew, or download it straight from GitHub. We can install the Flutter SDK in various ways. In this section, we will install the Flutter SDK and add it to our PATH variable so we can run the flutter command from any terminal window.
0 Comments
Leave a Reply. |