LoginSignup
2

More than 3 years have passed since last update.

posted at

updated at

macOS (OS X, Mac OS X) のバージョンを調べるコマンドやファイル

概要

  • macOS (OS X, Mac OS X) のバージョンをコマンドやファイルの中身を確認して調べる

sw_vers

sw_vers コマンドで macOS のバージョンを調べることができる。

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.14.6
BuildVersion:   18G84

表示される項目はそれぞれの以下の意味を持っている。

  • ProductName: OS の名称
  • ProductVersion: OSのリリースバージョン
  • BuildVersion: OSのリビジョン番号

man sw_vers コマンドでマニュアルを見ることができる。

NAME
sw_vers -- print Mac OS X operating system version information

SYNOPSIS
sw_vers
sw_vers -productName
sw_vers -productVersion
sw_vers -buildVersion

The ProductName property provides the name of the operating system release (typically
either "Mac OS X" or "Mac OS X Server"). The ProductVersion property defines the
version of the operating system release (for example, "10.2.4" or "10.3"). The
BuildVersion property provides the specific revision of the operating system as gen-
erated by the Mac OS X build system.

system_profiler SPSoftwareDataType

system_profiler コマンドを使うとハードウェアやソフトウェアの情報を調べることができる。
データタイプに SPSoftwareDataType を指定すると、 macOS のバージョン情報などが出力される。

$ system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 10.14.6 (18G84)
      Kernel Version: Darwin 18.7.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: your-computer-name
      User Name: your-name (your-name)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 3 days 2:11

man system_profiler コマンドでマニュアルを見ることができる。

NAME
system_profiler -- reports system hardware and software configuration.

SYNOPSIS
system_profiler [-usage]
system_profiler [-listDataTypes]
system_profiler [-xml] dataType1 ... dataTypeN
system_profiler [-xml] [-detailLevel level]

DESCRIPTION
system_profiler reports on the hardware and software configuration of the system. It
can generate plain text reports or XML reports which can be opened with System Infor-
mation.app

/System/Library/CoreServices/SystemVersion.plist

$ cat /System/Library/CoreServices/SystemVersion.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>ProductBuildVersion</key>
    <string>18G84</string>
    <key>ProductCopyright</key>
    <string>1983-2019 Apple Inc.</string>
    <key>ProductName</key>
    <string>Mac OS X</string>
    <key>ProductUserVisibleVersion</key>
    <string>10.14.6</string>
    <key>ProductVersion</key>
    <string>10.14.6</string>
    <key>iOSSupportVersion</key>
    <string>12.3.1</string>
</dict>
</plist>

uname

$ uname -m
x86_64

$ uname -p
i386

$ uname -r
18.7.0

$ uname -s
Darwin

$ uname -v
Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64

$ uname -a
Darwin your-host-name 18.7.0 Darwin Kernel Version 18.7.0: Thu Jun 20 18:42:21 PDT 2019; root:xnu-4903.270.47~4/RELEASE_X86_64 x86_64

man uname コマンドでマニュアルを見ることができる。

NAME
uname -- Print operating system name

SYNOPSIS
uname [-amnprsv]

DESCRIPTION
The uname utility writes symbols representing one or more system characteristics to
the standard output.

 The following options are available:

 -a      Behave as though all of the options -mnrsv were specified.

 -m      print the machine hardware name.

 -n      print the nodename (the nodename may be a name that the system is known by to
         a communications network).

 -p      print the machine processor architecture name.

 -r      print the operating system release.

 -s      print the operating system name.

 -v      print the operating system version.

 If no options are specified, uname prints the operating system name as if the -s
 option had been specified.

macOS という名称について

Mac OS X → OS X → macOS と名称が変化している。

macOS - Wikipedia

2001年に最初の製品版が発売された時の名称は「Mac OS X(マック オーエス テン)」であった。2012年にリリースされたOS X Mountain Lionより正式名称から「Mac」が外され、「OS X(オーエス テン)」と称した。さらに、2016年にリリースされたmacOS Sierraより、iOSやwatchOS、tvOSのアップルの他のOSの名前との親和性を図るため、「OS X」から「macOS」へと改称された。

参考資料

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
What you can do with signing up
2