This is the 21st day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

Install and configure Flutter on A Mac environment. This article describes how to install Flutter on a Mac environment. After the actual operation side will feel that the environment configuration is the most basic, pay attention to it is easy to solve. Reference: Flutter Chinese website

System environment

  1. Flutter recommends a Mac environment in 64-bit macOS (64-bit);
  2. More than 700 MEgabytes of disk space, not including Xcode and Android Studio space;
  3. Git has been installed on your computer.

The installation diagram

  1. Git clone -b beta github.com/flutter/flu…

2. Yes, normallycloneSuccess, but the small dish computer did not installXCode, prompts are as follows:

xcrun: error: invalid active developer path (/Library/Developer/
CommandLineTools), missing xcrun at: /Library/Developer/
CommandLineTools/usr/bin/xcrun
Copy the code
  1. If XCode has been installed, please skip this step and install XCode. Terminal -> xcode-select –install. The installation is successful in about 2-3 minutes, as shown in the figure:

  1. Add PUB_HOSTED_URL and FLUTTER_STORAGE_BASE_URL and set PATH to add Flutter to PATH as follows:
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
export PATH=`pwd`/flutter/bin:$PATH

export PATH=$HOME/flutter/bin:$PATH
echo $PATH
Copy the code

Add export PATH=$HOME/flutter/bin:$PATH and refresh the current window.

5. Terminal ->Flutter doctorAnd then everything went well, as shown in the picture:

At this point,FlutterThe environment has been installed and configured successfully, which, combined with the last blog post,Windows 和 MacThe environment has been built, the first step of the long march is completed, the next should be a lot of attempts and research!


If you want to query the Git path on your Mac, go to the terminal -> which Git.


Source: Little Monk A Ce