Managing the Google Cloud CLI (gcloud) on your macOS system can be accomplished through two primary methods: using Homebrew or performing a manual installation. Below are concise guides for both installing and uninstalling the CLI using these methods.
Ensure Homebrew is Updated: Open Terminal and run:
brew update
Install Google Cloud SDK: Execute:
brew install --cask google-cloud-sdk
Initialize gcloud: After installation, initialize the CLI:
gcloud init
Uninstall the SDK: In Terminal, run:
brew uninstall --cask google-cloud-sdk
Remove Residual Files: To delete remaining configuration or cache files:
rm -rf ~/.config/gcloud
rm -rf ~/Library/Caches/google-cloud-sdk