mas is a command-line interface for the Mac App Store that is designed for scripting & automation.
The mas custom Homebrew tap provides pre-built bottles for all macOS versions since 10.11 (El Capitan).
The newest versions of mas, however, are only available for macOS 10.15+ (Catalina or newer).
To install mas from the custom tap:
brew install mas-cli/tap/masAlternatively, binaries & sources are available from GitHub Releases.
mas requires Swift 5 runtime support. macOS 10.14.4 (Mojave) & newer include it, but earlier releases do not. Without it, running mas might report errors similar to:
dyld: Symbol not found: _$s11SubSequenceSlTl
To get Swift 5 support on macOS versions older than 10.14.4 (Mojave), you can:
- Update to macOS 10.14.4 (Mojave) or newer.
 - Install the Swift 5 Runtime Support for Command Line Tools.
 - Install Xcode 10.2 or newer to 
/Applications/Xcode.app. 
Each application in the Mac App Store has a unique integer app identifier (ADAM ID) & a unique text app identifier (bundle ID). mas commands accept either form of app ID as arguments.
mas search & mas list can be used to find the ADAM IDs of apps.
Alternatively, to find an app's ADAM ID:
- Find the app in the Mac App Store
 - Select 
Share>Copy Link - Extract the ADAM ID from the URL.
- e.g., extract ADAM ID 
497799835from the URL for Xcode (https://apps.apple.com/us/app/xcode/id497799835?mt=12) 
 - e.g., extract ADAM ID 
 
The commands in this section do not require you to be logged into an Apple Account, neither for your macOS user nor for the Mac App Store.
mas search <search-term> searches by name for applications available from the Mac App Store.
Providing the --price flag includes each app's price in the output.
$ mas search Xcode
497799835 Xcode
688199928 Docs for Xcode
…All the commands in this section require you to be logged into an Apple Account for your macOS user.
mas list outputs all the applications on your Mac that were installed from the Mac App Store.
$ mas list
497799835 Xcode       (15.4)
640199958 Developer   (10.6.5)
899247664 TestFlight  (3.5.2)mas outdated outputs all applications installed from the Mac App Store on your Mac that have pending updates.
$ mas outdated
497799835 Xcode (15.4 -> 16.0)
640199958 Developer (10.6.5 -> 10.6.6)Run mas update to install pending updates.
All the commands in this section require you to be logged into an Apple Account in the Mac App Store.
Depending on your Apple Account settings, you might need to re-authenticate yourself in the Mac App Store to perform a get, install, lucky, or update, even if you are already signed in to an Apple Account in the Mac App Store.
mas get <app-id>… installs free applications that you haven't yet gotten/"purchased" from the Mac App Store.
The
purchasealias is currently a misnomer, because it currently can only "purchase" free apps. To purchase apps that cost money, purchase them directly in the Mac App Store.
$ mas get 497799835
==> Downloading Xcode
==> Installed Xcodemas install <app-id>… installs apps that you have already gotten or purchased from the Mac App Store. Providing the
--force flag re-installs the app even if it is already installed on your Mac.
$ mas install 497799835
==> Downloading Xcode
==> Installed XcodeAll the commands in this section require you to be logged into an Apple Account in the Mac App Store.
mas only installs/updates applications from the Mac App Store.
Use
softwareupdate(8)to install system updates (e.g., Xcode Command Line Tools, Safari, etc.)
mas update updates outdated apps installed from the Mac App Store. Without any arguments, it updates all such apps.
$ mas update
Upgrading 2 outdated applications:
Xcode (15.4) -> (16.0)
Developer (10.6.5) -> (10.6.6)
==> Downloading Xcode
==> Installed Xcode
==> Downloading Developer
==> Installed DeveloperUpdates can be performed selectively by providing app IDs to mas update.
$ mas update 715768417
Upgrading 1 outdated application:
Xcode (15.4) -> (16.0)
==> Downloading Xcode
==> Installed XcodeAll the commands in this section interact with the Apple Account for which you are signed in to the Mac App Store. These commands do not interact with the Apple Account for which your macOS user is signed in.
⛔ The
signincommand is not supported on macOS 10.13 (High Sierra) or newer. On those macOS versions, sign in via the Mac App Store instead (see the known issue).
On macOS 10.12 (Sierra) or older, mas signin <apple-id> signs in to the specified Apple Account in the Mac App Store.
$ mas signin [email protected]
Password:Providing the --dialog flag signs in using a graphical dialog provided by Mac App Store.
mas signin --dialog [email protected]You can also embed your password in the command.
mas signin [email protected] MyPasswordIf mas is installed:
brew bundle dumpincludes installed Mac App Store apps in the generatedBrewfile.- Homebrew Bundle commands will process Mac App Store apps included in a 
Brewfile. 
See the Homebrew Bundle documentation for more details.
If mas is installed, running Topgrade updates installed Mac App Store apps.
mas uses multiple undocumented Apple private frameworks to implement much of its functionality.
Over time, Apple has silently changed these frameworks, breaking some functionality, including:
The Mac App Store operates on eventual consistency.
The versions seen by various parts of mas or the Mac App Store might be inconsistent for days (#384 & #387).
Apple Silicon Macs can install iOS & iPadOS apps from the Mac App Store.
mas does not yet support such apps (#321).
mas depends on the same XPC system services as the Mac App Store.
mas thus experiences similar problems as the pasteboard when running inside tmux.
This wrapper allows pasteboard & mas to work inside tmux.
tmux can be configured to always use the wrapper.
Alternatively, the wrapper can be used on a one-off basis:
brew install reattach-to-user-namespace
reattach-to-user-namespace mas installmas 2.0.0+ sources data for installed Mac App Store apps from macOS's Spotlight Metadata Server (aka MDS).
You can check if a Mac App Store app is properly indexed in the MDS:
## General format:
$ mdls -rn kMDItemAppStoreAdamID <path-to-app>
## Outputs the ADAM ID if the app is indexed
## Outputs nothing if the app is not indexed
## Example:
$ mdls -rn kMDItemAppStoreAdamID /Applications/WhatsApp.app
310633997If an app has been indexed in the MDS, the path to the app can be found:
mdfind 'kMDItemAppStoreAdamID == <adam-id>'If any of Mac App Store apps are not indexed, the MDS can be enabled/rebuilt for all file system volumes:
sudo mdutil -Eai onIf the following error occurs, you probably haven't yet gotten or purchased the app from the Mac App Store (#46).
This redownload is not available for this Apple Account either because it was bought by a different user or the item was refunded or canceled.
If mas doesn't work as expected (e.g., apps can't be installed/updated), run mas reset, then try again.
If the issue persists, please file a bug.
All feedback is much appreciated!
mas can be built in Xcode or built by the following script:
Scripts/buildBuild output can be found in the .build folder in the project's root folder.
Code is under the MIT license.
mas was originally created by Andrew Naylor (@argon on GitHub / @argon on X).
