- Summary
- Install
- Usage
- List Already Installed Apps from the App Store
- Search for an App
- Get Status of a Specific App by ID
- Get Detailed Info About a Specific App by ID
- Install an App
- Uninstall an App
- Save All Installed Packages
- Install All Packages from Saved List
- See Outdated Apps
- Upgrade An Installed App
- Upgrade All Installed Apps
Open source macOS command interface to the App Store.
Using Homebrew:
brew install masmas listExample: Shazam
mas search Shazam 897118787 Shazam: Identify Songs (2.11)
545519333 Amazon Prime Video (10.114)
1320450034 DaftCloud (4.2.0)
1478418722 Just Dance Now (8.3.0)
1556054655 Vinyls (2.3.2)
1599264580 WaveSavr (1.0)
6449814769 Swipefy for Spotify (2.11.6)
6742663367 tynlau - music recogniser (2025.2)
1549017891 BeatsBuddy (5.1.0)
1525123200 Shared: Music and Podcasts (4.0.5)
6748985865 Daft Music: Music Player (1.6.3)
6476125287 Dynamic-Lyrics (1.9.1)
1561696730 DiscoCat: Discography Catalog (1.2.2)
975364678 SongPop Classic - Music trivia (2.38.2)
1592867431 Music Recognizer (1.1)
1563765031 Crane Sudoku - Puzzle game (0.1.1)
6739261943 TrackTrack - Gather Playlists (1.0)
The first entry is the one we want, note the App ID on the left is 897118787.
mas get <app_id>
Using the App ID from above for the Shazam app:
mas get 897118787Warning: Already got Shazam (897118787)
mas lookup 897118787Shazam: Identify Songs 2.11 [Free]
By: Apple Distribution International
Released: 2022-08-11
Minimum OS: 10.14
Size: 11.8 MB
From: https://apps.apple.com/gb/app/shazam-identify-songs/id897118787?mt=12&uo=4
mas install <app_id> [<app_id2> ...]
Install Shazam by its App ID:
mas install 897118787Warning: Already installed Shazam (897118787)
The lucky command installs the top hit for the search term, in the Shazam case above we know it's the top hit:
mas lucky ShazamWarning: Already installed Shazam (897118787)
mas uninstall <app_id>Create a text file list of all the installed App Store apps with their IDs,
stripping off the trailing version numbers using cut:
mas list | cut -c-40 >> mas-packages.txtYou can see my list in HariSekhon/DevOps-Bash-tools - setup/mas-packages.txt.
First stripping out all # comment lines and then passing the first column of App IDs to mas install:
sed 's/#.*//' mas-packages.txt | awk '{print $1}' | xargs mas installmas outdated 663592361 DuckDuckGo (1.169.0 -> 1.174.0)
406056744 Evernote (10.158.1 -> 11.1.2)
408981434 iMovie (10.4.2 -> 10.4.4)
409183694 Keynote (14.4 -> 14.5)
1295203466 Microsoft Remote Desktop (10.9.9 -> 11.3.2)
409203825 Numbers (14.4 -> 14.5)
409201541 Pages (14.4 -> 14.5)
803453959 Slack (4.46.101 -> 4.47.72)
747648890 Telegram (12.1 -> 12.4.1)
310633997 WhatsApp (25.37.76 -> 26.3.75)
497799835 Xcode (15.4 -> 26.2)
Upgrade WhatsApp using its ID as seen in the leftmost column above:
mas upgrade 310633997It will download and then macOS will pop-up prompt you to close WhatsApp desktop if it's open.
==> Downloading WhatsApp Messenger (26.3.75)
==> Downloaded WhatsApp Messenger (26.3.75)
==> Updating WhatsApp Messenger (26.3.75)
==> Updated WhatsApp Messenger (26.3.75)
If you trying upgrading an app like Shazam which is already at the latest version then there will be no output and a zero exit code.
Using the Shazam app with ID 897118787 from further above:
mas upgrade 897118787No output.
mas upgrade