On a Mac machine, you have several ways to update the operating system and applications. The traditional way to get and install new updates is to use the official Mac App Store on your machine. Open the Terminal app and run the following command in it. Softwareupdate -i -a. Update Mac Apps From Terminal. Feb 26, 2003 sudo '/Applications/TextEdit.app/Contents/MacOS/TextEdit' (The -b flag can be specified to run appropriate applications in the background. You can't use & and sudo when an authentication password is required, necessitating the need for the -b flag.).
Every once in a while, you’ll find that an update is available for either your macOS system or the apps installed on your machine. It’s important that you keep your system software and apps up to date. This ensures your system is stable and your apps are bug-free.
On a Mac machine, you have several ways to update the operating system and applications. The traditional way to get and install new updates is to use the official Mac App Store on your machine.
However, you’re not tied to it to install your updates. You can also use the Terminal app to find, download, and install various updates on your machine. There are even configurable options letting you decide how these updates should be installed.
Update The macOS Version From Terminal
Terminal has a command that checks for all the available updates for macOS and allows you to download and install them on your machine. The command also lets you update Apple apps such as iTunes on your Mac.
What it doesn’t do though is to install updates for the third-party apps installed on your machine. For those apps, you’re going to need to install a package that is described in the later part of this guide.
Find Available macOS System Updates
The first thing you’ll want to do is check what updates are available for your macOS and Apple apps. Checking doesn’t necessarily mean downloading or installing updates. It’s just to give you an idea what needs to be updated on your Mac.
Launch the Terminal app using your preferred method on your Mac.
When the app launches, type in the following command and press Enter.
softwareupdate -l
It’ll look for all the available updates and display them in your Terminal window. The information you’ll see include the app names, size of the update, whether the update is recommended or not, and whether the update requires rebooting your machine.
You can also check the updates with Terminal and then install them from the App Store, if you want to do it that way.
Download macOS System Updates
After finding out what updates are available, you might want to download those updates to your Mac. Keep in mind that downloading also doesn’t require you to install the updates. You can just keep the updates downloaded and not install them right away.
Macos Execute App From Terminal
Install Downloaded macOS Updates
The updates you download using the Terminal command can’t be manually installed. These updates can only be installed using a command in the Terminal app.
To install them, you need to first find out the name of the update and then use that name below to get the update installed on your Mac.
It’ll let you know when the update is installed on your machine. This shouldn’t take too long as the update is already downloaded on your Mac and it just needs to be installed.
Download & Install All macOS Updates
What you did in the above sections was update things bit by bit. What if you want to find, download, and install all the macOS updates in one go? Well, Terminal has you covered.
There’s a command that lets you install all the available updates on your Mac in a single execution.
The command will get all updates installed and let you know when it’s done. This’ll take longer than the above methods as it first downloads all the updates and then installs them one by one on your machine.
![]() Update Mac Apps From Terminal
Third-party apps that aren’t developed by Apple require different commands to be updated from the Terminal on your Mac. These app updates won’t show up when you run the commands mentioned above.
In order to be able to update all of your Mac Store Apps, you’re going to need to install Homebrew followed by ‘mas’ on your machine. It’ll then let you update your other apps.
Open the Terminal app and run the following command in it to install Homebrew.
/usr/bin/ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”
When Homebrew is installed, type in the following command and press Enter to install the mas utility.
brew install mas
When mas is installed, you can run the following command to see a list of all the apps that can be updated using this utility.
mas list
Type in the following command and press Enter to see all the apps that require an update.
mas outdated
Run the following command to update all the outdated apps. It’ll first download updates for all the outdated apps and then install them so expect a good amount of time before it finishes.
mas upgrade Mac Terminal App
Wait while the utility updates your apps. When it’s done, you can close the Terminal window.
You don’t necessarily need to keep mas and Homebrew installed on your Mac if you don’t plan to update your apps using this way in the future. Uninstalling them won’t affect the updated apps on your Mac so it’s safe to remove them if you want.
Calling Command-Line Tools
In AppleScript, the
do shell script command is used to execute command-line tools. This command is implemented by the Standard Additions scripting addition included with OS X.
Note
The Terminal app in
/Applications/Utilities/ is scriptable and provides another way to execute command-line tools from scripts.
Executing Commands
The direct parameter of the
do shell script command is a string containing the shell code you want to execute, as demonstrated in Listing 39-1, which simply lists a directory.
APPLESCRIPT
Listing 39-1AppleScript: Executing a simple shell command that lists the contents of a directory
Since the direct parameter of
do shell script is a string, you can concatenate it with other strings at run time. Listing 39-2, for example, concatenates a shell command to a previously defined parameter value.
APPLESCRIPT
Listing 39-2AppleScript: Concatenating a command with a value
Quoting Strings
The shell uses space characters to separate parameters and gives special meaning to certain punctuation marks, such as
$ , ( , ) , and * . To ensure that strings are treated as expected—for example, spaces aren’t seen as delimiters—it’s best to wrap strings in quotes. This process is known as quoting. If your string contains quotes, they must also be escaped (preceded by a / character) so they are interpreted as part of the string. Listing 39-3 shows an example of an error occurring as a result of a parameter that contains a space.
APPLESCRIPT
Listing 39-3AppleScript: An error resulting from a string containing a space
The easiest way to quote a string is to use the
quoted form property of the text class, as demonstrated in Listing 39-4. This property returns the string in a form that’s safe from further interpretation by the shell, regardless of its contents.
APPLESCRIPT
Listing 39-4AppleScript: Quoting a string to prevent errors
More Information
For more information about the
do shell script command, see Commands Reference in AppleScript Language Guide and Technical Note TN2065.
Copyright © 2018 Apple Inc. All rights reserved. Terms of Use | Privacy Policy | Updated: 2016-06-13
HBO GO is a free streaming service for people who subscribe to HBO through a participating TV provider. With HBO GO, you get access to all of HBO—every episode of every season of HBO’s unforgettable original series, plus more of the biggest and latest hit movies before any other streaming service. Como usar la app xbox en una macbook pro desde cero.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |