Class: OS


CloudControl Pro 9 Docs / device / OS

Class: OS

device.OS

OS provides system information, such as system version number and version name.

Example

const { OS } = require('device');
console.log(OS.sdkName); // e.g. "7.1"
console.log(OS.sdkVersionCode); // e.g. 25

Table of contents

Properties

Accessors

Methods

Properties

ANDROID_BASE

Static Readonly ANDROID_BASE: AndroidVersion

Android 1.0

See

requiresAndroidVersion


ANDROID_BASE_1_1

Static Readonly ANDROID_BASE_1_1: AndroidVersion

Android 1.1

See

requiresAndroidVersion


ANDROID_CUPCAKE

Static Readonly ANDROID_CUPCAKE: AndroidVersion

Android 1.5

See

requiresAndroidVersion


ANDROID_DONUT

Static Readonly ANDROID_DONUT: AndroidVersion

Android 1.6

See

requiresAndroidVersion


ANDROID_ECLAIR

Static Readonly ANDROID_ECLAIR: AndroidVersion

Android 2.0

See

requiresAndroidVersion


ANDROID_ECLAIR_0_1

Static Readonly ANDROID_ECLAIR_0_1: AndroidVersion

Android 2.0.1

See

requiresAndroidVersion


ANDROID_ECLAIR_MR1

Static Readonly ANDROID_ECLAIR_MR1: AndroidVersion

Android 2.1.x

See

requiresAndroidVersion


ANDROID_FROYO

Static Readonly ANDROID_FROYO: AndroidVersion

Android 2.2.x

See

requiresAndroidVersion


ANDROID_GINGERBREAD

Static Readonly ANDROID_GINGERBREAD: AndroidVersion

Android 2.3

See

requiresAndroidVersion


ANDROID_GINGERBREAD_MR1

Static Readonly ANDROID_GINGERBREAD_MR1: AndroidVersion

Android 2.3.3

See

requiresAndroidVersion


ANDROID_HONEYCOMB

Static Readonly ANDROID_HONEYCOMB: AndroidVersion

Android 3.0.x

See

requiresAndroidVersion


ANDROID_HONEYCOMB_MR1

Static Readonly ANDROID_HONEYCOMB_MR1: AndroidVersion

Android 3.1.x

See

requiresAndroidVersion


ANDROID_HONEYCOMB_MR2

Static Readonly ANDROID_HONEYCOMB_MR2: AndroidVersion

Android 3.2

See

requiresAndroidVersion


ANDROID_ICE_CREAM_SANDWICH

Static Readonly ANDROID_ICE_CREAM_SANDWICH: AndroidVersion

Android 4.0

See

requiresAndroidVersion


ANDROID_ICE_CREAM_SANDWICH_MR1

Static Readonly ANDROID_ICE_CREAM_SANDWICH_MR1: AndroidVersion

Android 4.0.3

See

requiresAndroidVersion


ANDROID_JELLY_BEAN

Static Readonly ANDROID_JELLY_BEAN: AndroidVersion

Android 4.1

See

requiresAndroidVersion


ANDROID_JELLY_BEAN_MR1

Static Readonly ANDROID_JELLY_BEAN_MR1: AndroidVersion

Android 4.2

See

requiresAndroidVersion


ANDROID_JELLY_BEAN_MR2

Static Readonly ANDROID_JELLY_BEAN_MR2: AndroidVersion

Android 4.3

See

requiresAndroidVersion


ANDROID_KITKAT

Static Readonly ANDROID_KITKAT: AndroidVersion

Android 4.4.2

See

requiresAndroidVersion


ANDROID_KITKAT_WATCH

Static Readonly ANDROID_KITKAT_WATCH: AndroidVersion

Android 4.4W

See

requiresAndroidVersion


ANDROID_L

Static Readonly ANDROID_L: AndroidVersion

Android 5.0

See

requiresAndroidVersion


ANDROID_LOLLIPOP_MR1

Static Readonly ANDROID_LOLLIPOP_MR1: AndroidVersion

Android 5.1

See

requiresAndroidVersion


ANDROID_M

Static Readonly ANDROID_M: AndroidVersion

Android 6.0

See

requiresAndroidVersion


ANDROID_N

Static Readonly ANDROID_N: AndroidVersion

Android 7.0

See

requiresAndroidVersion


ANDROID_N_MR1

Static Readonly ANDROID_N_MR1: AndroidVersion

Android 7.1

See

requiresAndroidVersion


ANDROID_O

Static Readonly ANDROID_O: AndroidVersion

Android 8.0

See

requiresAndroidVersion


ANDROID_O_MR1

Static Readonly ANDROID_O_MR1: AndroidVersion

Android 8.1

See

requiresAndroidVersion


ANDROID_P

Static Readonly ANDROID_P: AndroidVersion

Android 9

See

requiresAndroidVersion


ANDROID_Q

Static Readonly ANDROID_Q: AndroidVersion

Android 10

See

requiresAndroidVersion


ANDROID_R

Static Readonly ANDROID_R: AndroidVersion

Android 11

See

requiresAndroidVersion


ANDROID_S

Static Readonly ANDROID_S: AndroidVersion

Android 12

See

requiresAndroidVersion

Accessors

incremental

Static get incremental(): string

The internal value used by the underlying source control to represent this build. E.g., a perforce changelist number or a git hash.

See

https://developer.android.com/reference/android/os/Build.VERSION#INCREMENTAL

Returns

string


release

Static get release(): string

The user-visible version string. E.g., "1.0" or "3.4b5" or "bananas". This field is an opaque string. Do not assume that its value has any particular structure or that values of RELEASE from different releases can be somehow ordered.

See

https://developer.android.com/reference/android/os/Build.VERSION#RELEASE

Returns

string


sdkName

Static get sdkName(): string

Android version name, such as "10", "7.0", "4.4W". For a new Android version, it may return "unknown".

Returns

string


sdkVersionCode

Static get sdkVersionCode(): number

Get the current system's SDK version, which is the Android API version. For example, Android 10 is 29, Android 7.0 is 24. The complete corresponding table can be found in SDK Platform release notesopen in new window.

See

https://developer.android.com/reference/android/os/Build.VERSION#SDK_INT

Returns

number


securityPatch

Static get securityPatch(): string

The user-visible security patch level. This value represents the date when the device most recently applied a security patch.

See

https://developer.android.com/reference/android/os/Build.VERSION#SECURITY_PATCH

Returns

string

Methods

requiresAndroidVersion

Static requiresAndroidVersion(version, message?): void

Require running on the given Android version or higher. If the current system version is lower than the given version, then throw an exception with the given message.

Example

"nodejs";

const { OS } = require('device');
OS.requiresAndroidVersion(OS.ANDROID_N);

Parameters

Name Type Description
version AndroidVersion The minimum Android version
message string The exception message, default to ”Requires Android ${version.name}(API ${version.code}) to run this code“

Returns

void