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/getDeviceInfo.md.

getDeviceInfo

获取设备基础信息。

扫码预览

扫码预览 getDeviceInfo

支持版本

前端库版本不低于 0.0.32。

支持平台

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

支持场景

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

调用方式

异步 API

getDeviceInfo(params?: object): Promise<GetDeviceInfoResult>

入参

无。

调用示例

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

const result = await getDeviceInfo();

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 仅 Android 返回
  • iOS:不返回 abi、deviceAbi、cpuType
  • PC:Flow Web 浏览器的 platform 返回 web;Windows、macOS 桌面客户端分别返回 windows、mac,不返回 Android 专属字段