Operating system
The information refer to the operating system of the device
Available information
On desktop target the available operating system information are the below:
| Category | Property | Description | Source |
|---|---|---|---|
| App Info | name |
The name of the application | OperatingSystem.queryInstalledApps |
version |
The version of the application | ||
vendor |
The vendor or publisher of the application | ||
timestamp |
The installation or last modified timestamp of the application in milliseconds since epoch | ||
additionalInfo |
A map containing additional application details | ||
| OS Info | family |
The family or type of the operating system | OperatingSystem.family |
manufacturer |
The manufacturer of the operating system | OperatingSystem.manufacturer |
|
versionInfo |
The version information of the operating system | OperatingSystem.versionInfo |
|
| System Info | bitness |
The bitness of the operating system | OperatingSystem.bitness |
systemUptime |
The system uptime in milliseconds since the operating system started | OperatingSystem.systemUptime |
|
systemBootTime |
The time in milliseconds when the system was last booted (Unix timestamp) | OperatingSystem.systemBootTime |
|
isElevated |
A flag indicating whether the operating system is running with elevated privileges | OperatingSystem.isElevated |
|
| File System Info | fileSystem |
The file system information of the operating system | OperatingSystem.fileSystem |
| Process Info | processId |
The process ID of the currently running operating system process | OperatingSystem.processId |
currentProcess |
The currently running process of the operating system | OperatingSystem.currentProcess |
|
processCount |
The total number of processes running on the operating system | OperatingSystem.processCount |
|
| Thread Info | threadId |
The thread ID of the currently running thread | OperatingSystem.threadId |
currentThread |
The currently running thread of the operating system | OperatingSystem.currentThread |
|
threadCount |
The total number of threads running on the operating system | OperatingSystem.threadCount |
|
| Network Info | internetProtocolStats |
The internet protocol statistics related to network connections | OperatingSystem.internetProtocolStats |
| Network Params | networkParams |
The network parameters of the operating system | OperatingSystem.networkParams |
| Service Info | services |
The list of services running on the operating system | OperatingSystem.services |
| Session Info | sessions |
The list of user sessions currently active on the operating system | OperatingSystem.sessions |
API source
The information are retrievable using the DesktopInfo.OperatingSystem API:
OperatingSystem API
Retrieve a OperatingSystem instance from desktopInfo instance
Properties
The below properties are miscellaneous readable properties provided by the operatingSystem instance
family
The family or type of the operating system
manufacturer
The manufacturer of the operating system
processId
The process ID of the currently running operating system process
processCount
The total number of processes running on the operating system
threadId
The thread ID of the currently running thread
threadCount
The total number of threads running on the operating system
bitness
The bitness of the operating system
systemUptime
The system uptime in seconds since the operating system started
systemBootTime
The timestamp when the system was last booted (Unix timestamp)
val systemBootTime: Long = operatingSystem.systemBootTime
println(systemBootTime) // e.g. 1760598078
isElevated
A flag indicating whether the operating system is running with elevated privileges (e.g., as an administrator)
services
The list of services running on the operating system
sessions
The list of user sessions currently active on the operating system
Methods
The below methods are provided by operatingSystem instance, and are useful to interact with the operating system to retrieve any available information
getProcesses
Retrieves the list of all running processes on the operating system
Interfaces
- OSProcess - Represents a process in the operating system
getProcess
Retrieves a single process by its process ID
Parameters
- pid
:Int- The process ID of the process to retrieve
Interfaces
- OSProcess - Represents a process in the operating system
getOSDesktopWindows
Retrieves the desktop windows of the operating system
Parameters
- visibleOnly
:Boolean- A flag indicating whether to retrieve only the visible desktop windows (true) or all desktop windows (false)
Interfaces
- OSDesktopWindow - Represents a desktop window on the operating system
val desktopWindows: List<OSDesktopWindow> = operatingSystem.getOSDesktopWindows(
visibleOnly = // true or false
)
println(desktopWindows)
parseNestedStatistics
Parses /proc files with a given structure consisting of a keyed header line followed by a keyed value line
Parameters
- procFile
:String- The file to process - keys
:vararg String- Optional array of keys to include in the outer map. If not provided, all keys found in the file will be returned
val nestedStatistic: Map<String, Map<String, Long>> = operatingSystem.parseNestedStatistics(
procFile =, // proc file,
keys = // requested keys
)
println(nestedStatistic)
// e.g.
// {
// "TcpExt": {"SyncookiesSent": 0, "SyncookiesRecv": 4, "SyncookiesFailed": 0, ... },
// "IpExt": {"InNoRoutes": 55, "InTruncatedPkts": 0, "InMcastPkts": 27786, "OutMcastPkts": 1435, ... },
// "MPTcpExt": {"MPCapableSYNRX": 0, "MPCapableSYNTX": 0, "MPCapableSYNACKRX": 0, ... }
// }
parseStatistics
Parses /proc files formatted as "statistic (long)value" to produce a simple mapping
Parameters
- procFile
:String- The file to process - separator
:Regex- A regular expression specifying the separator between the statistic name and its value
val statistics: Map<String, Long> = operatingSystem.parseStatistics(
procFile =, // proc file,
separator = // custom separator
)
println(statistics)
// e.g.
// {
// "Ip6InReceives": 8026,
// "Ip6InHdrErrors": 0,
// "Icmp6InMsgs": 2,
// "Icmp6InErrors": 0,
// ...
// }
queryInstalledApps
Method used to retrieve the current installed applications on the system
Interfaces
- ApplicationInfo - Represents common information about an installed application
val installedApps: List<ApplicationInfo> = operatingSystem.queryInstalledApps()
println(installedApps)
findInstalledApp
Method used to find an installed application by name
Parameters
- name
:String- The name of the application to find
Interfaces
- ApplicationInfo - Represents common information about an installed application
val installedApp: ApplicationInfo? = operatingSystem.findInstalledApp(
name = "MyApp"
)
println(installedApp)
findInstalledApps
Method used to find an installed applications list by a filter condition
Parameters
- applicationFilter
:(ApplicationInfo) -> Boolean- The filter used to determine whether the application must be included in the retrieved list
Interfaces
- ApplicationInfo - Represents common information about an installed application