# uni.getDeviceInfo(options?)

获取设备信息

# # 参数

名称 类型 必填 默认值 描述
options GetDeviceInfoOptions - -

# # GetDeviceInfoOptions 属性值

名称 类型 必备 默认值 描述
filter Array<string> - 过滤字段的字符串数组,假如要获取指定字段,传入此数组。

# # 返回值

类型
GetDeviceInfoResult

# # GetDeviceInfoResult 属性值

名称 类型 必备 默认值 描述
brand string - 设备品牌
deviceBrand string - 设备品牌
deviceId string - 设备 id 。由 uni-app 框架生成并存储,清空 Storage 会导致改变
model string - 设备型号
deviceModel string - 设备型号
deviceType string - 设备类型phone、pad、pc
deviceOrientation string - 设备方向 竖屏 portrait、横屏 landscape
devicePixelRatio string - 设备像素比
system string - 操作系统及版本
platform string - 客户端平台
oaid string - oaid标识 Android专有
isRoot boolean - 是否root
isSimulator boolean - 是否是模拟器
isUSBDebugging boolean - adb是否开启
idfa string - idfa标识 iOS专有
# # GetDeviceInfoResult 兼容性
安卓系统版本 安卓 uni-app 安卓 uni-app-x iOS 系统版本 iOS uni-app iOS uni-app-x
oaid 5.0 9.0 x x
isUSBDebugging 5.0 9.0 x x
idfa 5.0 x x 9.0

# # getDeviceInfo 兼容性

安卓系统版本 安卓 uni-app 安卓 uni-app-x iOS 系统版本 iOS uni-app iOS uni-app-x
4.4 3.9.0 9.0 3.9.0

# # 参见

getDeviceInfo

# # 通用类型

# # GeneralCallbackResult

名称 类型 必备 默认值 描述
errMsg string - 错误信息