Как настроить переменную PATH для Flutter SDK в MacOS

  1. Open Terminal.
  2. Determine which shell you are using by running the following command:
echo $SHELL
  1. 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
  1. 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
  1. Save the file and exit:
  • For nano: Press Ctrl + X, then Y, then Enter.
  1. Apply the changes:
  • For Bash: source ~/.bash_profile
  • For Zsh: source ~/.zshrc
  • For Fish: Restart the terminal.