Welcome to like, reprint please indicate the source
Required for System Installation
Minimum requirements for system installation:
- Operating system: macOS (64-bit)
- Disk space: 2.8 GB (not including disk space occupied by various IDES/Tools).
- Tools: The following command-line tools are available
- Bash or ZSH
- curl
- Git 2.x (optional)
- mkdir
- rm
- unzip
- which
Download the Flutter SDK
As of 27 January 2020, the latest Stable version of Flutter SDK is V1.12.13 + Hotfix.7. Download various stable versions of macOS here. Use Flutter in the Chinese network environment
Unpack the Flutter SDK
Run the following example command on the macOS terminal (terminal.app) :
cd~ / development unzip ~ / Downloads/flutter_macos_v1. 12.13 + hotfix. 7 - stable. ZipCopy the code
The decompressed directory should be in English and does not contain special characters such as Spaces.
Add a Flutter to a system environment variable
For macOS Catalina, Z shell is used by default, so you need to edit the $HOME/. ZSHRC file. You can run the vi command in terminal mode. Such as:
export PATH="$PATH:[PATH_TO_FLUTTER_GIT_DIRECTORY]/flutter/bin"
Copy the code
The [PATH_TO_FLUTTER_GIT_DIRECTORY] section is replaced with the path where you actually decompress the Flutter SDK. The PATH setting does not take effect immediately after editing the. ZSHRC file. You need to run the source $HOME/. ZSHRC file or restart the terminal. To verify that the Flutter global path is configured successfully, run the following command on a new terminal:
which Flutter
Copy the code
If the corresponding Flutter installation path is displayed, the Flutter installation is successful.
Alternatively, run the following command to check whether a flutter path is set:
echo $PATH
Copy the code
Note: macOS can configure paths in various ways, such as /etc/paths.
Flutter installation diagnosis
Run the Flutter doctor command to diagnose whether there are still dependencies required for flutter development that are not installed or not successfully installed. The missing dependencies are also automatically downloaded and connected (such as Dart’s SDK). For example, the result of a flutter Doctor execution on my computer is as follows:
Because the SDK update
Readers of the details can see that the previous version running Flutter hints is V1.9.1, not the latest version. We can update the FLUTTER SDK to the latest version by executing the flutter upgrade command.
Flutter version v1.9.1 + hotfix. 6Copy the code
Q&A
- ZSHRC, close the terminal, open the terminal again, and run which flutter. The flutter path did not take effect. For operating systems prior to macOS Catalina, bash was used by default, as shown in the terminal title bar below:
After you upgrade to Catalina, perform the upgrade as prompted
chsh -s /bin/zsh
Copy the code
After executing, re-open the terminal and you can see that the default shell has been changed to ZSH
Install and Configure Flutter (Windows)