Installing the Flutter SDK on MacOS

This article will walk through installing the Flutter SDK for Mac.

The Flutter SDK consists of various tools and programs that allow for Flutter development. This article will take us through the steps necessary to install that SDK.

Determine the Mac Chipset

The chipset of our Mac will be either Apple (arm64) or Intel (x64). We should check this before we begin with our installation. First, open the Apple menu in the top left corner of your screen and select About This Mac. Selecting will open a dialog where we can find our chipset information.

Select top left corner About This Mac

Make a note of which chipset your Mac is using so the correct version of the Flutter SDK can be downloaded.

About this Mac Dialog Box showing Chipset

Downloading and Unzipping

Download the Flutter SDK for the correct chipset and extract the zip into a new Flutter folder on our hard drive. For example, we could put the Flutter SDK in our user directory /Users/codecademy/flutter. Note that the word codecademy should be replaced with our username on the Mac.

Determining the Mac shell version

We now need to tell our Mac about the Flutter SDK. This requires the terminal to update our shell configuration. On a Mac, the shell is responsible for launching other programs.

For more information about using the terminal command line, check out this course!

We can open up a terminal by typing ⌘/Command + Space and typing terminal.

Once the Terminal is open, type the following to determine the shell our Mac uses.

echo $SHELL

The command will output the active shell in use.

If we see /bin/bash, we will modify .bashrc. If we see /bin/zsh, we will instead modify .zshrc.

Both files, .bashrc or .zshrc, reside in the home folder. Let’s edit them and add a path to the Flutter SDK.

Editing Your Mac Path

Now we know the shell script to use; we can edit the path to include an additional entry for the bin folder inside our Flutter SDK folder.

We will use the nano editor, but you can use any editor for this step. Another example is vi.

In our terminal, we first open the script file:

For example:

nano /Users/codecademy/.zshrc

Note that the username codecademy should be replaced with our username on the Mac.

Let’s add a line to the end of this script file:

For example:

export PATH="$PATH:/Users/codecademy/flutter/bin"

Again, use the username instead of codecademy here.

Next, hit ⌃/Control + o to save the file. Hit enter to confirm the file name.

We can exit now with ⌃/Control + x

We should now close the terminal program and re-open it again for the change to take effect.

Open a new terminal and test the Flutter SDK by entering the following command:

flutter --version

The output should look similar to the following:

Flutter 3.3.10 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 135454af32 (6 weeks ago) • 2022-12-15 07:36:55 -0800
Engine • revision 3316dd8728
Tools • Dart 2.18.6 • DevTools 2.15.0

When we see this output, we know we have successfully installed the Flutter SDK!

Review

Congratulations! Let’s review what we learned about installing the Flutter SDK on the Mac:

  • We need to download the correct zip for our Mac’s chipset.
  • We unzip the file into a folder (for example, /Users/codecademy/flutter).
  • We edit our shell script and update the path variable to include the bin folder from the Flutter SDK (for example, /Users/codecademy/flutter/bin).
  • To test the installation, we should open a new terminal and enter flutter –version.

Author

Codecademy Team

'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'

Meet the full team