Skip to main content
Solved

iLife app update from command line?

  • July 5, 2016
  • 13 replies
  • 60 views

Forum|alt.badge.img+13

Hello JN,

I am struggling to find a way to update iLife Suite apps. I found this: https://acdesigntech.wordpress.com/2013/03/06/disable-mac-app-store-receipts-to-reenable-downloaded-update-packages/

I tested the method mentioned and it does indeed take the apps out of the scope of Software Update in the App Store and eliminate having to touch each machine with an AppleID and password (cool!).

Now, I just cannot seem to find any way to update from the command line similar to this one: sudo softwareupdate -iav which I run in a script after image.

What are all of you doing to keep these up to date automatically-either at image time or continuously? I would rather not have to package with composer overtime there is an update from Apple?

I am aware of VPP and have that in process. Outside of that, what other options are there?

TIA,

/randy

Best answer by tobiaslinder

Hi Randy

Give the mas command a try:

https://github.com/argon/mas

This will make you very happy. Something like this works fine:

#!/bin/sh
# 20160628 - 05:52 - tobiaslinder

# Apple Store Credentials
id=yourAppleID
psswd=yourAppleIDPassword

############################ NO CHANGES AFTER THIS LINE ############################
# Signout Apple ID
/usr/local/mas/mas signout

sleep 5

# Signin Apple ID
/usr/local/mas/mas signin $id $psswd

sleep 5

# Install GarageBand
/usr/local/mas/mas install 682658836

sleep 5

# Install iMovie
/usr/local/mas/mas install 408981434

sleep 5

# Signout Apple ID
/usr/local/mas/mas signout

exit 0

13 replies

tobiaslinder
Forum|alt.badge.img+16
  • Valued Contributor
  • Answer
  • July 7, 2016

Hi Randy

Give the mas command a try:

https://github.com/argon/mas

This will make you very happy. Something like this works fine:

#!/bin/sh
# 20160628 - 05:52 - tobiaslinder

# Apple Store Credentials
id=yourAppleID
psswd=yourAppleIDPassword

############################ NO CHANGES AFTER THIS LINE ############################
# Signout Apple ID
/usr/local/mas/mas signout

sleep 5

# Signin Apple ID
/usr/local/mas/mas signin $id $psswd

sleep 5

# Install GarageBand
/usr/local/mas/mas install 682658836

sleep 5

# Install iMovie
/usr/local/mas/mas install 408981434

sleep 5

# Signout Apple ID
/usr/local/mas/mas signout

exit 0

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • July 7, 2016

I second looking at deploying and using the mas command line tool. Its quite cool and may allow you to do exactly what you;re looking for. Just so you know, typically App Store apps can't be updated or installed without entering your password. Hence why @tobiaslinder's script above needs to log out of MAS, and then back in. It kind of gets around the issue. You might want to consider storing the account and password details in script parameters rather than hardcoded into the script though.


tobiaslinder
Forum|alt.badge.img+16
  • Valued Contributor
  • July 8, 2016

Hi @mm2270 Good point to put the login info into the parameters. Thanks!


Forum|alt.badge.img+13
  • Author
  • Contributor
  • July 8, 2016

Very cool! Thanks for this.

I am not certain I really want Brew on my image, Can I just use something like Composer and drop the binary in /usr/local/mas/ capture it and push?

Thanks again!

/randy


mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • July 8, 2016
Can I just use something like Composer and drop the binary in /usr/local/mas/ capture it and push?

Totally! I didn't use brew to install it. The github page has precompiled binaries. Just download, add into a usual location like /usr/local/, package up and deploy away!


boberito
Forum|alt.badge.img+22
  • Jamf Heroes
  • July 8, 2016

Mind blown....I cant wait to use this.


tobiaslinder
Forum|alt.badge.img+16
  • Valued Contributor
  • July 9, 2016

@boberito same here! We would really love to use VPP device based assignment but as long as this works so unreliable on OSX the mas command is really a lifesaver when you have to update Pages, Keynote, Numbers etc.


Forum|alt.badge.img+13
  • Author
  • Contributor
  • July 21, 2016

Followup: My script and policy are firing off perfectly. On certain machines, it completes but when I look at "Show" I see it actually is failing with:

Script result: The operation couldn’t be completed. (MASErrorDomain error 6.)

Any ideas why?

/randy


tobiaslinder
Forum|alt.badge.img+16
  • Valued Contributor
  • July 22, 2016

Hi @Randydid I see the same error with two clients and will the others not. This is so weird. Can't tell you at the moment what is going wrong here.

With best regards, Tobias Linder


Forum|alt.badge.img+13
  • Author
  • Contributor
  • August 22, 2016

This is working very well for me. I have just one final question: Where/how do you find the Application number shown in the script above?

TIA,

/randy


mpermann
Forum|alt.badge.img+22
  • Valued Contributor
  • August 22, 2016

@Randydid the number appears in the link to the application in the App Store. If you click the disclosure triangle next to Install in the App Store, it will allow you to Copy Link. If you paste that link you will see the number. For instance, the link for GarageBand is https://itunes.apple.com/us/app/garageband/id682658836?mt=12 and the 682658836 is the numerical ID for GarageBand. There is probably other ways to get the ID that's just the one I typically use.


Forum|alt.badge.img+13
  • Author
  • Contributor
  • August 22, 2016

@mpermann Thanks!

/randy


Forum|alt.badge.img+13
  • Author
  • Contributor
  • January 12, 2017

This solution has been working for some time however, it appears to be hanging more often lately. Is it possible something has changed on the Apple Side?

/randy