それマグで!

知識はカップより、マグでゆっくり頂きます。 takuya_1stのブログ

習慣に早くから配慮した者は、 おそらく人生の実りも大きい。

brew でMacAppStoreを管理するコマンドmas-cliをインストール

MacAppStore のアプリをコマンドから

若者のMacAppStore離れが深刻ですが。MacAppstoreはアレはアレで便利には使えるものです。

Mas = Mac App Storeをコマンドからつかう

https://github.com/argon/mas を使うとコマンドから管理できるということなのでヤってみた。

インストール

brew でぱぱっと github から持ってくる。

takuya@~$ brew install argon/mas/mas
==> Tapping argon/mas
Cloning into '/usr/local/Library/Taps/argon/homebrew-mas'...
remote: Counting objects: 3, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 3 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
Checking connectivity... done.
Tapped 1 formula (25 files, 16.7K)
==> Installing mas from argon/mas
==> Downloading https://github.com/argon/mas/releases/download/v1.1.0/mas-cli.zip
==> Downloading from https://github-cloud.s3.amazonaws.com/releases/40092232/3170f432-d2be-11e5-999e-161b8e383e09.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credent
######################################################################## 100.0%^[
🍺  /usr/local/Cellar/mas/1.1.0: 2 files, 4.2M, built in 8 seconds

使い方の流れ

mas search Xcode  ## idを検索
mas install 497799835 ## idを指定

mas search で id を探す、mas install ID でインストール

インストール済み一覧を出す

takuya@~$ mas list
539883307 LINE
894760156 Desktop Clock free
409183694 Keynote
946680495 MARKETSPEED
417375580 BetterSnapTool
409183694 Keynote
428834068 YoruFukurou
421358730 MenuTab for Facebook
409789998 Twitter
408981381 iPhoto
425955336 Skitch
411678673 SourceTree
467939042 Growl
451444120 Memory Clean
586862299 Duplicate Cleaner For iPhoto
497799835 Xcode
412485838 Witch
409201541 Pages
409203825 Numbers
403388562 Transmit
408981434 iMovie
415181149 CalendarFree
715768417 Microsoft Remote Desktop
411213048 LadioCast
803453959 Slack
409203825 Numbers
449589707 Dash

help でサブコマンドが出てくる

takuya@~$ mas help
Available commands:

   account    Prints the primary account Apple ID
   help       Display general or command-specific help
   install    Install from the Mac App Store
   list       Lists apps from the Mac App Store which are currently installed
   outdated   Lists pending updates from the Mac App Store
   signin     Sign in to the Mac App Store
   signout    Sign out of the Mac App Store
   upgrade    Performs all pending updates from the Mac App Store
   version    Print version number

outdated 更新してないものを見つける

takuya@~$ mas outdated
539883307 LINE (4.4.1)

install は ID 指定

takuya@~$ mas install 539883307
==> Downloading LINE
==> Installed LINE

install 実行するとMacAppStore でログインダイアログがでてログインするとインストール開始

インストール済を管理するには便利そう

購入したけど使ってないものや、新規で購入ってのは難しそうですね。

参考資料

mas-cli: MacでApp Storeのアプリをコマンドラインからインストールする

2018-08-16

追記修正