Version: v6On this page@capacitor/deviceThe Device API exposes internal information about the device, such as the model and operating system version, along with user information such as unique ids.Installnpm install @capacitor/devicenpx cap syncExampleimport { Device } from '@capacitor/device';const logDeviceInfo = async () => { const info = await Device.getInfo(); console.log(info);};const logBatteryInfo = async () => { const info = await Device.getBatteryInfo(); console.log(info);};APIgetId()getInfo()getBatteryInfo()getLanguageCode()getLanguageTag()InterfacesType AliasesgetId()getId() => Promise<DeviceId>Return an unique identifier for the device.Returns: Promise<DeviceId>Since: 1.0.0getInfo()getInfo() => Promise<DeviceInfo>Return information about the underlying device/os/platform.Returns: Promise<DeviceInfo>Since: 1.0.0getBatteryInfo()getBatteryInfo() => Promise<BatteryInfo>Return information about the battery.Returns: Promise<BatteryInfo>Since: 1.0.0getLanguageCode()getLanguageCode() => Promise<GetLanguageCodeResult>Get the device's current language locale code.Returns: Promise<GetLanguageCodeResult>Since: 1.0.0getLanguageTag()getLanguageTag() => Promise<LanguageTag>Get the device's current language locale tag.Returns: Promise<LanguageTag>Since: 4.0.0InterfacesDeviceIdPropTypeDescriptionSinceidentifierstringThe identifier of the device as available to the app. This identifier may change on modern mobile platforms that only allow per-app install ids. On iOS, the identifier is a UUID that uniquely identifies a device to the app’s vendor (read more). on Android 8+, the identifier is a 64-bit number (expressed as a hexadecimal string), unique to each combination of app-signing key, user, and device (read more). On web, a random identifier is generated and stored on localStorage for subsequent calls. If localStorage is not available a new random identifier will be generated on every call.1.0.0DeviceInfoPropTypeDescriptionSincenamestringThe name of the device. For example, "John's iPhone". This is only supported on iOS and Android 7.1 or above. On iOS 16+ this will return a generic device name without the appropriate entitlements.1.0.0modelstringThe device model. For example, "iPhone13,4".1.0.0platform'ios' | 'android' | 'web'The device platform (lowercase).1.0.0operatingSystemOperatingSystemThe operating system of the device.1.0.0osVersionstringThe version of the device OS.1.0.0iOSVersionnumberThe iOS version number. Only available on iOS. Multi-part version numbers are crushed down into an integer padded to two-digits, ex: "16.3.1" -> 1603015.0.0androidSDKVersionnumberThe Android SDK version number. Only available on Android.5.0.0manufacturerstringThe manufacturer of the device.1.0.0isVirtualbooleanWhether the app is running in a simulator/emulator.1.0.0memUsednumberApproximate memory used by the current app, in bytes. Divide by 1048576 to get the number of MBs used.1.0.0diskFreenumberHow much free disk space is available on the normal data storage path for the os, in bytes. On Android it returns the free disk space on the "system" partition holding the core Android OS. On iOS this value is not accurate.1.0.0diskTotalnumberThe total size of the normal data storage path for the OS, in bytes. On Android it returns the disk space on the "system" partition holding the core Android OS.1.0.0realDiskFreenumberHow much free disk space is available on the normal data storage, in bytes.1.1.0realDiskTotalnumberThe total size of the normal data storage path, in bytes.1.1.0webViewVersionstringThe web view browser version1.0.0BatteryInfoPropTypeDescriptionSincebatteryLevelnumberA percentage (0 to 1) indicating how much the battery is charged.1.0.0isChargingbooleanWhether the device is charging.1.0.0GetLanguageCodeResultPropTypeDescriptionSincevaluestringTwo character language code.1.0.0LanguageTagPropTypeDescriptionSincevaluestringReturns a well-formed IETF BCP 47 language tag.4.0.0Type AliasesOperatingSystem'ios' | 'android' | 'windows' | 'mac' | 'unknown'