I would like to force an update of App Store applications from the command line.
How can I do this?
Apple doesn't supply a command line helper or any scriptable cocoa classes you can latch on to for automation. Unlike the overall software update, which allows updates and installs out of the box, you can script the process of clicking buttons with a mouse using Automator.
However, the app store has been reverse engineered and released open source as well as a binary form:
The install is quick and it appears to be quite reliable on the current version of OS X 10.11:
With the source released, I would expect some other implementations of this tool to pop up, perhaps even one scripted with python.
If someone is logged into the mac (windowmanager is running), you can use Automator and the "watch me do" function to automate updates and storing your store password in the script fairly insecurely.
Here are two tutorials to get you started if this meets your needs.
Once you have a working script, you can use the command line
If the App Store app ever exposes that function to scripting you will have more options from the command line. It would be easy to use
The App Store is simply not suitable for administration. Barely a quasi-package manager, it is not nearly as useful or reliable as real package managers like pkgsrc, FreeBSD ports, aptitude, RPM, macports or even softwareupdate. In my experience, it is unpredictable and a beard for commercial developers to hock their wares. So there is really only one rational and responsible way, as a competent administrator, to work with App Store:
And just put it out of your mind, it won't trouble you any longer. ;-)
Use ARD instead, though not a package manager, it manages packages, installations, updates, and upgrades, it will do what you want, save you time, and will not let you down:
For Apple Remote Desktop 3, for 10.9:
Check out the admin guide first to convince yourself that this is the way to go:
but that might throw a funny error if not running 10.9, or if no previous version of ARD is installed, and if it does, try:
or to equal effect (either/or here, don't need to use both pkgutil and xar... I'm just being thorough):
And we no longer need the disk image attached, so eject it:
And now what you'll see if you
What's in the Payload file, which is a cpio archive compressed with gzip, is what you're after. So with a few piped commands we can get to the app bundle:
And you're nearly done.
Now you have installed Apple Remote Desktop Admin 3.7.2
So all that's left to do is purchase your license:
Launch /Applications/Remote\ Desktop.app and serialize. And get some work done.
For 10.6 Snow Leopard, you'll need a slightly earlier version of ARD:
and if it throws back at you this:
drill down to the Payload:
And you're nearly done:
purchase your license:
Launch /Applications/Remote\ Desktop.app and serialize. And get something done.
You can use the
Lists all available updates.
Installs all available updates.