Flutter Setup on Mac OS

Flutter Setup on Mac OS

In the previous article, I explained how to set up Flutter SDK in a Windows environment. In this article, I'll teach you how to set up Flutter SDK in the MacOS environment.

here are the minimum system requirements of the Mac Operating System to set up the Flutter SDK and tools.

System requirements.

you need to meet the minimum requirements to install and run the flutter.

  • Operating systems - macOS, version 10.14 (Mojave) or later.

  • Disk Space - 2.8 GB (does not include disk space for IDE/tools).

  • Tools - Flutter uses git for installation and upgrade. We recommend installing Xcode, which includes git, but you can install git separately.

Very Important instruction.

If you're installing on an Apple Silicon Mac, You must have the Rosetta translation environment available for some ancillary tools. You can install this manually by running the following command.

sudo softwareupdate --install-rosetta --agree-to-license

Install Flutter SDK

If you meet the system requirement you can install the Flutter SDK. Here are the steps that you need to follow.

1 - Two SDK bundles are for Apple Mac OS. Make sure to confirm your processor and download SDK respectively.

2 - Extract the downloaded SDK file in the desired location. here is an example.

cd ~/development

unzip ~/Downloads/flutter_macos_3.13.9-stable.zip

3 - After completing the extraction, Add the flutter tool to your path variable.

export PATH="$PATH:`pwd`/flutter/bin"

The above command sets your PATH variable for the current terminal window only. To permanently add Flutter to your path, please follow the below steps.

Update your path

You can update your PATH variable for the current session at the command line. To update the variable permanently you can run flutter commands in any terminal session.

The steps for modifying the PATH variables in all subsequent terminal sessions are machine-specific. Typically, you add a line to a shell script file that executes whenever you open a new window. here are the steps below.

1 - determine the path of your clone of the Flutter SDK.

2 - Open (or create) the rc file for your shell. Typing echo $SHELL in your Terminal tells you which shell you’re using. If you’re using Bash, edit $HOME/.bash_profile or $HOME/.bashrc. If you’re using Z shell, edit $HOME/.zshrc. If you’re using a different shell, the file path and filename will be different on your machine.

3 - Add the following line and change [PATH_OF_FLUTTER_GIT_DIRECTORY] to be the path of your clone of the Flutter git repo:

export PATH="$PATH:[PATH_OF_FLUTTER_GIT_DIRECTORY]/bin"

4 - Run source $HOME/.<rc file> to refresh the current window, or open a new terminal window to automatically source the file.

5 - Verify that the flutter/bin directory is now in your PATH by running:

echo $PATH

6 - Verify that the flutter command is available by running:

which flutter

Check the Flutter environment status

Flutter introduces the dedicated command to see if there are any platform dependencies you need to complete the setup.

flutter doctor

This Flutter command checks your environment and displays a report of the status of your Flutter environment and installation. The below figure shows the other software you might need to install or further tasks to perform.

Once you have installed any missing dependencies, you can run the flutter doctorcommand again to verify that you’ve set everything up correctly.

Next - Setting up your Flutter Development Environment of Linux

Happy Coding ❤