This guide will show you how to install Flutter on MacOS, and add Flutter CLI globally. Run the following commands in Terminal:
# Grab the latest stable version of Flutter
git clone https://github.com/flutter/flutter.git -b stable
# Move to /usr/local directory
mv ./flutter /usr/local/flutter
# Add Flutter CLI globally
echo 'export PATH="/usr/local/flutter/bin:$PATH"' >> ~/.bash_profile
Optionally, if you're using Oh My ZSH:
echo 'export PATH="/usr/local/flutter/bin:$PATH"' >> ~/.zshrc
That's it! You can now start using Flutter CLI. Be sure you open a new Terminal tab before you start using the flutter
command.
To update Flutter to the latest version, run the following:
cd /usr/local/flutter && git pull