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.

Update Mac App Store Apps from the Terminal with mas and Homebrew.
Photo by Nikolay Vasiliev / Unsplash

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:

  1. finding a download,
  2. downloading it,
  3. opening the installer,
  4. installing the application,
  5. and later finding updates,

you can often use Homebrew to manage the software directly from Terminal.

For example:

$ brew install wget

Homebrew 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 upgrade

Homebrew 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 application

doesn'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 list

can 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 682658836

The important distinction is:

Homebrew
   │
   └── manages Homebrew packages

mas
   │
   └── interfaces with the Mac App Store

Homebrew 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 --version

You should see the installed Homebrew version.

You can also check its configuration with:

$ brew config

Install mas

Once Homebrew is available:

$ brew install mas

Verify the installation:

$ mas version

You can also check where the executable is located:

$ which mas

On Apple Silicon Macs, Homebrew normally lives under:

$ /opt/homebrew

so you will commonly see:

$ /opt/homebrew/bin/mas

On Intel Macs, Homebrew traditionally uses:

$ /usr/local

The exact path therefore depends on your Mac's architecture and Homebrew installation.

Check Your Installed App Store Apps

Run:

$ mas list

You'll get a list similar to:

497799835 Xcode
682658836 GarageBand
409183694 Keynote
   │
   └── App Store identifier

The 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 outdated

If applications have updates available, mas will report them.

For example:

 497799835 Xcode 16.4 -> 16.5
   │
   └── App Store identifier

If 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 497799835

Replace the ID with the application's actual App Store ID.

For example:

$ mas upgrade 682658836

This targets that specific App Store application.

Update Everything

To update all outdated applications managed through mas:

$ mas upgrade

That'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 outdated

and then perform the upgrade:

$ mas upgrade

A simple workflow is therefore:

$ mas outdated
$ mas upgrade

Search the App Store

You don't necessarily need to know an application's ID beforehand.

You can search:

$ mas search "Xcode"

For example:

497799835 Xcode

The result gives you the application's App Store ID.

You can then use that ID with commands such as:

$ mas install 497799835

or:

$ mas upgrade 497799835

Install an App Store Application from Terminal

Once you know the App Store ID:

$ mas install APP_ID

For example:

$ mas install 497799835

This 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 upgrade

The 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 applications

Notice 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.

Keep Us Caffeinated  ⦿ ⦿
Spotify Logo
↑
SNUBmonkey Join our readers