Как настроить переменную PATH для Flutter SDK в MacOS
- Open Terminal.
- Determine which shell you are using by running the following command:
echo $SHELL
- Based on your shell, open the appropriate configuration file using the
nano
text editor:
- For Bash (default macOS shell):
nano ~/.bash_profile
- For Zsh (default for macOS Catalina and later):
nano ~/.zshrc
- For Fish:
nano ~/.config/fish/config.fish
- Add the following line to the file, replacing
[PATH_TO_FLUTTER_DIRECTORY]
with the path to the extracted Flutter SDK directory:
For Bash or Zsh:
export PATH="$PATH:[PATH_TO_FLUTTER_DIRECTORY]/flutter/bin"
For Fish:
set -gx PATH $PATH [PATH_TO_FLUTTER_DIRECTORY]/flutter/bin
- Save the file and exit:
- For
nano
: Press Ctrl + X, then Y, then Enter.
- Apply the changes:
- For Bash:
source ~/.bash_profile
- For Zsh:
source ~/.zshrc
- For Fish: Restart the terminal.