Category filter

Script to install Homebrew on Mac

For maximum productivity at work, employees must have access to updated software. However, managing the updates and requirements of each program on corporate devices can be a massive burden for users. Homebrew is a package manager that helps install libraries, packages, and other dependencies required to execute applications in any environment. With Hexnode’s Execute Custom Script action, deploy Homebrew on target macOS devices using customized scripts.


The Sample Scripts provided below are adapted from third-party Open-Source sites.

Script for Homebrew Installation

This customized script first checks if Homebrew is already installed on your device and, if not, checks for a series of conditions to prepare the device for installing Homebrew.

Rosetta 2 is a translation software designed to aid the hardware transition between Intel processors and Apple Silicon so that apps created for Intel can run on Apple Silicon. However, it does not come pre-installed on Apple Silicon devices. So, the script automatically downloads Rosetta 2 for Apple Silicon devices if it’s not present on the device and then installs Homebrew for the current user.


  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

  • Sample Script Repository