By using multiple third-party management suites, it’s fairly easy to deploy software applications to Mac computers. Apple’s native solution, Apple Remote Desktop, offers many of the same functions at a fraction of the price and with fewer setup requirements.
If your organization lacks the necessary infrastructure or, if you just need a quick, simple solution to deploy a few packages to your macOS devices, the Installer command is a great way to get apps pushed out in a pinch or scripted out to target devices, as needed.
Best of all, since the command runs on Terminal, and that app is included with all versions of macOS and OS X, it is free to use. Furthermore, all modern and legacy versions of the OS are supported, making it a boon for IT pros that must support various versions of Apple’s operating system in the enterprise.
SEE: System monitoring policy (Tech Pro Research)
Before jumping directly to the command and its syntax, you’ll need to adhere to these requirements.
- Apple computer with OS X or macOS
- Administrator credentials
- Applications to install in .PKG or .MPKG format
SEE: Top 20 Apple keyboard shortcuts for business users (free PDF) (TechRepublic)
How to deploy packages via Terminal
1. Launch Terminal.app.
2. Enter the following command to install it as an administrator.
installer -pkg /path/to/application.pkg -target /Applications
3. When prompted, enter the administrator password, or prefix the command in step #2 with sudo to prompt for the admin credential if you’re installing remotely via script or SSH.
Note: For .MPKG deployments, specify the default .mpkg only, and all other dependent .mpkg files will be automatically installed unless they’re disqualified by the integrity checking process.
How to deploy packages with logging
By default, applications installed using the Installer command are written to the event logger as an installation. If you wish to enable secondary logging to a centralized location or syslog server for verification, this can be accomplished by placing the following flag as a suffix to the Installer command.
installer -pkg /path/to/application.mpkg -target /Applications -dumplog /Volumes/Server/Share/installer.log
Have you utilized the Installer command in your organization? What tips or best practices do you have for deploying apps across the network using this method? Please share your thoughts in the comments.
Subscribe to the Developer Insider Newsletter
From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays