Platform

actual object Platform(source)

The Platform object represents the platform on which the code is running.

expect object Platform(source)

The Platform class provides information about the current platform.

This class is used for determining the type of platform and the operating system being used. It provides the following properties:

  • OS: The name of the operating system as a string.

  • type: The type of platform as an instance of the PlatformType enum class.

Usage example:

val osName = Platform.OS
val platformType = Platform.type
actual object Platform(source)

Properties

Link copied to clipboard
actual val OS: String

This variable represents the operating system on which the code is currently running.

expect val OS: String
actual val OS: String
Link copied to clipboard
actual val type: PlatformType

Represents the platform type.

expect val type: PlatformType
actual val type: PlatformType