For AI agents: the complete documentation index is available at /apps-plugin/docs/llms.txt, the full documentation bundle is available at /apps-plugin/docs/llms-full.txt, and this page is available as Markdown at /apps-plugin/docs/js-api/device/info/getDeviceInfoSync.md.

getDeviceInfoSync

同步获取设备基础信息。

扫码预览

扫码预览 getDeviceInfoSync

支持版本

前端库版本不低于 0.0.32。

支持平台

平台支持情况
Android支持
iOS支持
PC不支持
HarmonyOS不支持

支持场景

场景支持情况
页面支持
卡片支持

使用说明

  • platform 返回小写的客户端平台标识;benchmarkLevel 无法获取时返回 -1

调用方式

同步 API

getDeviceInfoSync(_params?: object): GetDeviceInfoResult

入参

无。

调用示例

import { getDeviceInfoSync } from '@doubao-dev/framework/api';

const result = getDeviceInfoSync();

console.log(result.brand, result.model, result.system);
console.log(result.platform, result.benchmarkLevel);

返回值

名称类型必返说明
abistring否豆包客户端二进制接口类型,仅 Android 支持。
benchmarkLevelnumber是设备性能等级,值越高性能越好;-1 表示未知。
brandstring是设备品牌。
cpuTypestring否设备 CPU 型号,仅 Android 支持。
deviceAbistring否设备二进制接口类型,仅 Android 支持。
memorySizestring是设备内存大小,单位 MB。
modelstring是设备型号。
platformstring是客户端平台。
systemstring是操作系统及版本。

返回示例

{
  "benchmarkLevel": 30,
  "brand": "Apple",
  "model": "iPhone 15 Pro",
  "system": "iOS 17.5",
  "platform": "ios",
  "memorySize": "8192"
}

平台差异

  • Android:abi、deviceAbi、cpuType 为可选字段,豆包无法获取时不返回
  • iOS:不返回 abi、deviceAbi、cpuType