Flutter Installation - Mac
Flutter is a free and open source UI framework that was released in 2017 and originally developed by Google. Flutter enables developers to create cross-platform applications using only one codebase. It is a fantastic tool for developers as it can drastically accelerate app development, reduce costs, and make cross-platform app updates easier.
Those platforms include all major ones used today, such as:
Android.
iOS.
Windows.
Mac.
Linux.
It is worth noting that Flutter works great for Android and iOS mobile apps and apps for web and desktop. Today, Flutter’s support for MacOS and Linux is still in beta.
This article showcases how to install and configure Flutter SDK on MacOS.
Pre-installation Requirements
Operating System: macOS (64-bit)
Disk Space: At least 2.8 GB of free space
Xcode: Version 12.0 or later with the Command Line Tools installed
Dart SDK: Flutter relies on Dart, so ensure you have the Dart SDK installed on your machine.
How to Install and Configure Flutter SDK on MacOS
Step 1: Download Flutter SDK
Download the Flutter SDK package by clicking on the button from their webpage.
Step 2: Extract the Files
Once the download completes, open the “Downloads” folder or the location where the ZIP file was saved and double-click on the downloaded ZIP file to extract its contents.
then move the extracted “flutter” folder to the desired location you want to install Flutter SDK, to ensure the program runs properly. For this tutorial, it will be stored in C:\development\flutter.
Step 3: Set Up Flutter Environment Variables
Open Terminal on your Mac ( You can find it in the “Applications” folder, under the “Utilities” subfolder ) and run the following command to open your shell profile configuration file.
open -e .bash_profile
If you’re using Zsh, run the following command instead:
open -e .zshrc
Add the following line at the end of the file and replace <path_to_flutter> with the actual path where you moved the "flutter" folder in Step 2.
export PATH="$PATH:<path_to_flutter>/flutter/bin"
Save the file and close the text editor.
Step 4: Verify Flutter Installation
Close and reopen the Terminal to apply the changes made to the shell profile configuration, then un the following command to verify the Flutter installation
flutter doctor
This command checks for any necessary dependencies and provides recommendations if anything is missing.
Step 5: Install Xcode
If you haven’t installed Xcode, visit the Mac App Store and search for “Xcode”.
Click on the “Get” or “Install” button to download and install Xcode.
Launch Xcode once the installation is complete and accept the license agreement, if prompted.
Step 6: Configure iOS Simulator
Open Xcode and navigate to “Preferences” from the “Xcode” menu.
Go to the “Locations” tab and ensure that the Command Line Tools dropdown displays the latest Xcode version.
Switch to the “Components” tab and click on the “Simulator” option.
Select a simulator (e.g., iPhone 11) and click on the “Download” button next to it to install the necessary simulator files.