Update Mac App Store Apps from the Terminal with mas and Homebrew.
You don't have to open the Mac App Store every time you want to update an application. With Homebrew and mas, you can check, install, and update Mac App Store applications directly from the command line.
macOS gives you a graphical way to manage applications through the App Store.
Open the App Store.
Click Updates.
And macOS takes care of the rest.
But if you live in the terminal, you don't have to break your workflow.
You can manage Mac App Store applications from the command line using mas, a command-line interface for the Mac App Store.
And because mas is distributed through Homebrew, this also gives us an opportunity to introduce one of the most useful package-management tools on macOS.
First: What Is Homebrew?
Homebrew is a package manager for macOS.
A package manager provides a convenient way to install and maintain software from the command line.
Instead of manually:
- finding a download,
- downloading it,
- opening the installer,
- installing the application,
- and later finding updates,
you can often use Homebrew to manage the software directly from Terminal.
For example:
$ brew install wgetHomebrew downloads the required package and installs it for you.
You can then update Homebrew's package information and upgrade installed software with:
$ brew update
$ brew upgradeHomebrew is particularly useful for developers, system administrators and anyone who prefers managing software from the command line.
Homebrew Does Not Replace the Mac App Store
This distinction is important.
Homebrew and the Mac App Store are different software-distribution systems.
Homebrew primarily manages software distributed through Homebrew's package ecosystem.
The Mac App Store manages applications distributed through Apple's App Store infrastructure.
Installing an application with:
$ brew install applicationdoesn't mean you're installing the App Store version of that application.
That's where mas comes in.
What Is mas?
mas is a command-line interface for the Mac App Store.
The name comes from Mac App Store.
It allows you to perform several App Store operations directly from Terminal.
For example:
$ mas listcan show applications installed through the Mac App Store.
You can also search the App Store:
$ mas search "GarageBand"And you can install an App Store application using its App Store identifier:
$ mas install 682658836The important distinction is:
Homebrew
│
└── manages Homebrew packages
mas
│
└── interfaces with the Mac App StoreHomebrew is essentially how we conveniently install mas.
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 configInstall 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 Apps
Run:
$ mas listYou'll get a list similar to:
497799835 Xcode
682658836 GarageBand
409183694 Keynote
│
└── App Store identifierThe number is the application's Mac App Store ID.
This identifier becomes useful when installing or managing individual applications.
Check for Available Updates
This is the command we're really interested in:
$ mas outdatedIf applications have updates available, mas will report them.
For example:
497799835 Xcode 16.4 -> 16.5
│
└── App Store identifierIf nothing needs updating, the command will return no outdated applications.
This is useful because you can quickly check the App Store from Terminal without opening the graphical application.
Update One Application
If you know the App Store ID (identifier), you can update a specific application:
$ mas upgrade 497799835Replace the ID with the application's actual App Store ID.
For example:
$ mas upgrade 682658836This targets that specific App Store application.
Update Everything
To update all outdated applications managed through mas:
$ mas upgradeThat's the equivalent of telling mas:
Update every installed Mac App Store application for which an update is available.
You can first check what is outdated:
$ mas outdatedand then perform the upgrade:
$ mas upgradeA simple workflow is therefore:
$ mas outdated
$ mas upgradeSearch the App Store
You don't necessarily need to know an application's ID beforehand.
You can search:
$ mas search "Xcode"For example:
497799835 XcodeThe result gives you the application's App Store ID.
You can then use that ID with commands such as:
$ mas install 497799835or:
$ mas upgrade 497799835Install an App Store Application from Terminal
Once you know the App Store ID:
$ mas install APP_IDFor example:
$ mas install 497799835This is particularly useful when setting up a new Mac.
Instead of opening the App Store and manually searching for applications, you can maintain a list of App Store IDs and install them from the terminal.
A Useful Setup Workflow
For a Mac where Homebrew and mas are already installed:
$ brew update
↓
$ brew upgrade mas
↓
$ mas outdated
↓
$ mas upgradeThe commands have different purposes:
brew update
↓
Refresh Homebrew's package information
brew upgrade mas
↓
Update the mas command itself
mas outdated
↓
Check Mac App Store applications
mas upgrade
↓
Update outdated App Store applicationsNotice that brew upgrade
Whether you’re updating a single application or keeping your entire Mac up to date, mas provides a simple way to check, install, and upgrade App Store applications directly from Terminal. For anyone who already relies on Homebrew and the command line, it’s a convenient addition that makes routine macOS maintenance faster, more consistent, and easier to automate.
We hope this was helpful.