Update Mac App Store Apps from the Terminal with mas and Homebrew.
Skip the App Store clicks. With `Homebrew` and `mas`, you can search, install, check for updates, and upgrade Mac App Store applications directly from Terminal—making macOS software maintenance faster and easier to automate.
macOS provides a graphical way to manage applications through the Mac App Store:
- Open the App Store.
- Click Updates.
- Select the available updates and let macOS handle the rest.
But if you prefer working in Terminal, you don't have to interrupt your workflow.
With mas, a command-line interface for the Mac App Store, you can search, install, and update App Store applications directly from Terminal.
And since mas is distributed through Homebrew, it's also a good opportunity to explore one of the most useful package managers in the macOS ecosystem.
What is Homebrew
Homebrew is a free and open-source package manager for macOS that simplifies installing, updating, and managing command-line tools, applications, and other software directly from Terminal.
A package manager automates much of the software installation and maintenance process. Instead of manually:
- Searching for the software online.
- Finding the appropriate download.
- Downloading the installation package.
- Running the installer or configuring the application.
- Checking for updates and installing newer versions.
You can use Homebrew to handle these tasks through a few simple commands.
For example, to install wget:
$ brew install wgetHomebrew resolves the required dependencies, downloads the appropriate package, and installs it on your system.
Once installed, you can manage your software directly from Terminal.
Update Homebrew's local package information:
$ brew updateThis retrieves the latest package definitions and metadata from Homebrew's repositories. It does not upgrade installed software.
Upgrade installed packages:
$ brew upgradeThis upgrades installed formulae and casks for which newer versions are available.
You can also check for outdated packages:
$ brew outdatedAnd inspect information about an installed package:
$ brew info wgetHomebrew is particularly useful for developers, system administrators, and anyone who prefers managing software through the command line rather than manually downloading and installing individual applications.
In short, Homebrew brings package management to macOS, making software installation, maintenance, and upgrades more consistent, repeatable, and convenient.
Homebrew Does Not Replace the Mac App Store
Although both Homebrew and the Mac App Store provide ways to install software on macOS, they operate through different software-distribution and package-management systems.
Homebrew primarily manages software distributed through its own package ecosystem, including command-line utilities, developer tools, libraries, and macOS applications distributed as casks.
The Mac App Store, on the other hand, distributes applications through Apple's official storefront and infrastructure, including its purchase, licensing, update, and distribution mechanisms.
For example, installing software through Homebrew:
$ brew install applicationdoes not mean you are installing the application's Mac App Store version. Homebrew installs the package or application from its configured sources, which may be entirely separate from Apple's App Store.
This distinction matters when an application is available through multiple distribution channels, particularly when licensing, purchase history, automatic updates, or App Store-specific features are involved.
That's where mas comes in.
What is mas
mas is an open-source command-line interface (CLI) for the Mac App Store.
The name mas is derived from Mac App Store.
It provides a way to interact with Apple's App Store directly from Terminal, allowing you to search for, install, update, and manage applications without navigating the graphical App Store interface.
What can you do with mas?
1. List installed Mac App Store applications
$ mas listDisplays applications installed through the Mac App Store, along with their App Store identifiers and installed versions where available.
2. Search the Mac App Store
$ mas search "GarageBand"Searches the App Store catalog for applications matching the specified name.
3. Install an application
$ mas install 682658836Installs the application associated with the specified App Store ID.
In this example, 682658836 is GarageBand's App Store identifier.
The Mac App Store must be accessible, and you may need to authenticate with your Apple Account to complete installation.
Understanding the relationship between Homebrew and mas
Although they work together, Homebrew and mas serve different purposes:
Homebrew
│
└── Manages software through Homebrew's
package ecosystem.
mas
│
└── Interfaces with Apple's
Mac App Store.So, where does Homebrew fit into all this?
Homebrew provides a convenient way to install mas itself:
$ brew install masOnce installed, mas provides command-line access to the Mac App Store.
In other words, Homebrew installs and manages mas, while mas interacts with Apple's App Store to manage App Store applications.
Install Homebrew
If Homebrew isn't already installed, you can install it from the official Homebrew installation method.
After installation, verify it:
$ brew --versionYou should see the installed Homebrew version.
You can also check its configuration with:
$ brew config
Install mas
Once Homebrew is available:
$ brew install masVerify the installation:
$ mas versionYou can also check where the executable is located:
$ which masOn Apple Silicon Macs, Homebrew normally lives under:
$ /opt/homebrewso you will commonly see:
$ /opt/homebrew/bin/masOn Intel Macs, Homebrew traditionally uses:
$ /usr/localThe exact path therefore depends on your Mac's architecture and Homebrew installation.
Check Your Installed App Store Applications
Once mas is installed, you can use it to inspect applications installed through the Mac App Store directly from Terminal.
To list your installed App Store applications, run:
$ mas listThe output will look similar to this:
497799835 Xcode
682658836 GarageBand
409183694 KeynoteEach entry contains two important pieces of information:
- App Store ID: The numeric identifier associated with the application.
- Application name: The name of the installed application.
For example:
682658836 GarageBand
│
└── Mac App Store identifierThese identifiers are particularly useful when installing, updating, or managing individual applications from the command line.
Check for Available Updates
One of the most useful mas commands is:
$ mas outdatedIt checks installed Mac App Store applications for available updates and reports those that have newer versions.
For example:
497799835 Xcode 16.4 -> 16.5Here:
497799835is the application's App Store ID.16.4is the currently installed version.16.5is the available update.
If no applications have available updates, mas outdated returns no outdated applications.
This is particularly convenient when maintaining a Mac through Terminal: you can check App Store updates without opening the graphical App Store application.
Update a Specific Application
You don't necessarily have to update every application at once.
If you already know an application's App Store ID, you can target it individually:
$ mas upgrade 497799835To update GarageBand, for example:
$ mas upgrade 682658836This requests an update for the specified App Store application, provided an update is available.
Replace the example ID with the actual identifier of the application you want to update.
Update All Applications
If you want to update every installed Mac App Store application with an available update, simply run:
$ mas upgradeThis instructs mas to upgrade all eligible outdated applications it manages.
You can first inspect which applications need updating:
$ mas outdatedThen perform the upgrades:
$ mas upgradeA straightforward maintenance workflow is therefore:
$ mas outdated
$ mas upgradeThe first command checks for available updates; the second installs them.
Search the Mac App Store
You don't need to know an application's App Store ID beforehand.
You can search the App Store catalog directly from Terminal using:
$ mas search "Xcode"For example, the results might include:
497799835 XcodeThe search result provides the application's name and its corresponding App Store ID.
You can then use that identifier with other mas commands.
For example, to install Xcode:
$ mas install 497799835Or to request an update:
$ mas upgrade 497799835Install an App Store Application from Terminal
Once you have identified the application's App Store ID, installation is straightforward:
$ mas install APP_IDFor example:
$ mas install 497799835This instructs mas to install the application associated with that identifier through the Mac App Store.
Depending on your system and account state, App Store authentication may be required.
Why is this useful?
This becomes particularly valuable when configuring a new Mac or rebuilding an existing development environment.
Instead of opening the App Store, searching for applications individually, and installing them manually, you can maintain a list of App Store IDs and automate much of the installation process.
For example, you could keep a simple text file containing your preferred applications:
497799835
682658836
409183694Then use a shell loop to install them:
$ while read -r app_id; do
mas install "$app_id"
done < app-store-apps.txtThis provides a repeatable approach to installing your App Store applications on another Mac.
A Useful Setup Workflow
Once Homebrew and mas are installed, you can combine both tools into a simple maintenance workflow.
For example, when preparing a Mac for regular maintenance:
$ brew update
$ brew upgrade mas
$ mas outdated
$ mas upgradeEach command performs a different task.
Understanding the workflow
brew update
│
└── Refreshes Homebrew's package information
and formula/cask definitions.
brew upgrade mas
│
└── Upgrades the mas command-line utility
if a newer version is available.
mas outdated
│
└── Checks installed Mac App Store applications
for available updates.
mas upgrade
│
└── Upgrades eligible outdated
Mac App Store applications.An important distinction: brew upgrade vs. mas upgrade
Notice that brew upgrade and mas upgrade are not interchangeable.
Homebrew:
$ brew upgradeUpgrades installed Homebrew formulae and casks for which newer versions are available.
To upgrade only mas:
$ brew upgrade masMac App Store:
$ mas upgradeUpgrades eligible applications installed through the Mac App Store.
The distinction is important because updating Homebrew managed software does not automatically update applications distributed through Apple's App Store.
Likewise, updating App Store applications through mas does not upgrade Homebrew packages.
Whether you're updating a single application or maintaining your entire Mac, mas makes it easy to search, install, and upgrade Mac App Store applications directly from Terminal. Combined with Homebrew, it offers a convenient way to manage software across both ecosystems, making routine macOS maintenance more consistent, efficient, and easier to automate.
We hope this was helpful.
Keep learning. Keep exploring. Stay secure.