> 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.

# getDeviceInfo

获取设备基础信息。

## 扫码预览

![扫码预览 getDeviceInfo](https://api.qrserver.com/v1/create-qr-code/?size=200x200\&data=doubao%3A%2F%2Fdoubao_apps%3Fapp_id%3Ddb_1McM5Ni%26path%3D%252Fpages%252Fapi%252Fdevice%252Fget-device-info%252Findex)

## 支持版本

前端库版本不低于 `0.0.32`。

## 支持平台

<table>
<thead>
<tr><th>平台</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>Android</td><td>支持</td></tr>
<tr><td>iOS</td><td>支持</td></tr>
<tr><td>PC</td><td>支持</td></tr>
<tr><td>HarmonyOS</td><td>不支持</td></tr>
</tbody>
</table>

## 支持场景

<table>
<thead>
<tr><th>场景</th><th>支持情况</th></tr>
</thead>
<tbody>
<tr><td>页面</td><td>支持</td></tr>
<tr><td>卡片</td><td>支持</td></tr>
</tbody>
</table>

## 调用方式

### 异步 API

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

## 入参

无。

## 调用示例

```typescript
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);
```

## 成功返回

<table>
<thead>
<tr><th>名称</th><th>类型</th><th>必返</th><th>说明</th></tr>
</thead>
<tbody>
<tr><td><code>abi</code></td><td><code>string</code></td><td>否</td><td>豆包客户端二进制接口类型，仅 Android 支持。</td></tr>
<tr><td><code>benchmarkLevel</code></td><td><code>number</code></td><td>是</td><td>设备性能等级，值越高性能越好；-1 表示未知。</td></tr>
<tr><td><code>brand</code></td><td><code>string</code></td><td>是</td><td>设备品牌。</td></tr>
<tr><td><code>cpuType</code></td><td><code>string</code></td><td>否</td><td>设备 CPU 型号，仅 Android 支持。</td></tr>
<tr><td><code>deviceAbi</code></td><td><code>string</code></td><td>否</td><td>设备二进制接口类型，仅 Android 支持。</td></tr>
<tr><td><code>memorySize</code></td><td><code>string</code></td><td>是</td><td>设备内存大小，单位 MB。</td></tr>
<tr><td><code>model</code></td><td><code>string</code></td><td>是</td><td>设备型号。</td></tr>
<tr><td><code>platform</code></td><td><code>string</code></td><td>是</td><td>客户端平台。</td></tr>
<tr><td><code>system</code></td><td><code>string</code></td><td>是</td><td>操作系统及版本。</td></tr>
</tbody>
</table>

### 返回示例

```json
{
  "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 专属字段
