15.5 设备模型数据库

设备模型数据库(友好名称)

macOS 伴侣应用在实例 UI 中显示友好的 Apple 设备模型名称,通过将 Apple 模型标识符(例如 iPad16,6Mac16,6)映射到人类可读的名称。

数据存储位置

映射数据以 JSON 格式存储在:

apps/macos/Sources/OpenClaw/Resources/DeviceModels/

数据来源

我们目前从 MIT 许可的仓库中提取映射数据:

  • kyle-seongwoo-jun/apple-device-identifiers

为了保持构建的确定性,JSON 文件被固定到特定的上游提交(记录在 apps/macos/Sources/OpenClaw/Resources/DeviceModels/NOTICE.md 中)。

更新数据库

按照以下步骤更新设备模型数据库:

1. 选择上游提交

选择要固定的上游提交(iOS 和 macOS 各一个)。

2. 更新提交哈希

apps/macos/Sources/OpenClaw/Resources/DeviceModels/NOTICE.md 中更新提交哈希。

3. 重新下载 JSON 文件

使用以下命令重新下载固定到这些提交的 JSON 文件:

IOS_COMMIT=""
MAC_COMMIT=""

curl -fsSL "https://raw.githubusercontent.com/kyle-seongwoo-jun/apple-device-identifiers/${IOS_COMMIT}/ios-device-identifiers.json" \
  -o apps/macos/Sources/OpenClaw/Resources/DeviceModels/ios-device-identifiers.json

curl -fsSL "https://raw.githubusercontent.com/kyle-seongwoo-jun/apple-device-identifiers/${MAC_COMMIT}/mac-device-identifiers.json" \
  -o apps/macos/Sources/OpenClaw/Resources/DeviceModels/mac-device-identifiers.json

4. 验证许可证

确保 apps/macos/Sources/OpenClaw/Resources/DeviceModels/LICENSE.apple-device-identifiers.txt 仍然与上游匹配(如果上游许可证发生变化,请替换它)。

5. 验证构建

验证 macOS 应用能够干净地构建(无警告):

swift build --package-path apps/macos

文档索引

获取完整的文档索引,请访问:https://docs.openclaw.ai/llms.txt

使用此文件在进一步探索之前发现所有可用页面。