Comprehensive Guide: Installing Flutter on Mac with Terminal Commands

Akhil Kumar
TheCodingWay
Published in
2 min readOct 26, 2023

Flutter is a powerful framework for building natively compiled applications for mobile, web, and desktop from a single codebase. In this guide, we’ll walk you through the process of installing Flutter on a Mac using terminal commands.

Prerequisites

Before you begin, ensure you have the following:

  • A Mac with macOS installed.
  • A working internet connection.

Step 1: Download Flutter

  1. Open your terminal.
  2. In the terminal window, enter the following command to download Flutter’s SDK:
git clone https://github.com/flutter/flutter.git -b stable

This command will clone the Flutter repository to your local machine.

Step 2: Add Flutter to PATH

  1. Navigate to your home directory:
cd ~
  1. Open your bash_profile file (or zshrc if you're using Zsh) using a text editor. You can use the nano editor:
nano .bash_profile
  1. Add the Flutter SDK path to the file. This is the directory where you cloned Flutter. Add the following line at the end of the file:
export PATH="$PATH:[PATH_TO_FLUTTER_DIRECTORY]/flutter/bin"

Replace [PATH_TO_FLUTTER_DIRECTORY] with the actual path to your Flutter directory.

  1. Save and exit the text editor (for nano, press CTRL + X, then Y, then Enter).
  2. Load your updated profile:
source .bash_profile

Step 3: Install Xcode Command Line Tools

  1. Install Xcode Command Line Tools using the following command:
xcode-select --install
  1. Follow the prompts to complete the installation.

Step 4: Verify Flutter Installation

  1. In the terminal, run the following command to verify that Flutter has been correctly installed:
flutter --version

You should see output indicating the Flutter version and Dart version.

Step 5: Complete Flutter Setup

  1. Run the following command to complete the Flutter setup:
flutter doctor

This will check your system for any additional requirements or dependencies needed for Flutter development.

Congratulations! You’ve successfully installed Flutter on your Mac using terminal commands. You’re now ready to start building amazing cross-platform applications.

Conclusion

In this guide, we covered the step-by-step process of installing Flutter on a Mac using terminal commands. With Flutter installed, you’re well-equipped to embark on your journey in mobile app development.

See Also

You May Also Enjoy

Happy coding!

Photo by Brett Jordan on Unsplash

--

--