Operating system
The information refer to the operating system of the device
Available information
On macOS target the available operating system information are the below:
| Category | Property | Description | Source |
|---|---|---|---|
| OS Info | operatingSystemVersion |
The version, code name, and build number of macOS | MacOsOperatingSystem.operatingSystemVersion |
| File Store | statfs |
The file store information for the root filesystem (/) |
MacOsOperatingSystem.statfs |
| Desktop Windows | visibleWindows |
A list of desktop windows currently reported as on-screen | MacOsOperatingSystem.visibleWindows |
| Desktop Windows | allWindows |
A list of all desktop windows returned by the native enumeration | MacOsOperatingSystem.allWindows |
| User Session | utmpx |
The first active user session found in the native records | MacOsOperatingSystem.utmpx |
| Process Info | procTaskAllInfo |
The current process and its thread information | MacOsOperatingSystem.procTaskAllInfo |
| IP Connections | socketFdInfo |
A list of accessible IP connections | MacOsOperatingSystem.socketFdInfo |
| IP Routes | rtMsgHdr2 |
A list of IP routes from the native routing table | MacOsOperatingSystem.rtMsgHdr2 |
| TCP Stats | tcpStat |
The native TCP statistics | MacOsOperatingSystem.tcpStat |
| UDP Stats | udpStat |
The native UDP statistics | MacOsOperatingSystem.udpStat |
API source
The information are retrievable using the MacOsInfo.operatingSystem API:
Retrieve a MacOsInfo instance before accessing the operating system information
OperatingSystem API
Retrieve a MacOsOperatingSystem instance from macOsInfo instance
Properties
The below properties are readable properties provided by the operatingSystem instance
Read an operating system property again to request updated information. Separate property reads query their data independently
operatingSystemVersion
The version information of the current macOS operating system
val operatingSystemVersion: MacOsVersionInfo = operatingSystem.operatingSystemVersion
println(operatingSystemVersion)
statfs
The file store information for the root filesystem (/)
Warning
Reading statfs throws an IllegalStateException when the root filesystem information cannot be read
visibleWindows
List of desktop windows currently reported as on-screen
val visibleWindows: List<MacOsDesktopWindow> = operatingSystem.visibleWindows
println(visibleWindows)
allWindows
List of desktop windows returned by the native enumeration, including windows that are not on-screen
utmpx
The first active user session found in the native utmpx records
Warning
Reading utmpx throws an IllegalStateException when no active user session can be read
procTaskAllInfo
The current process running the application. Its threads are available through threadDetails
socketFdInfo
List of IP connections from socket descriptors accessible to the application
Socket descriptors whose information cannot be read or mapped are omitted from the list
rtMsgHdr2
List of IP routes read from the native routing table
tcpStat
The native TCP statistics
Reading tcpStat throws an IllegalStateException when the native statistics query fails
udpStat
The native UDP statistics
Reading udpStat throws an IllegalStateException when the native statistics query fails