Files
openclaw/docs/zh-CN/reference/device-models.md
2026-02-02 16:38:25 +01:00

2.1 KiB
Raw Permalink Blame History

read_when, summary, title, x-i18n
read_when summary title x-i18n
更新设备型号标识符映射或 NOTICE/许可证文件
更改实例 UI 中设备名称的显示方式
OpenClaw 如何内置 Apple 设备型号标识符以在 macOS 应用中显示友好名称。 设备型号数据库
generated_at model provider source_hash source_path workflow
2026-02-01T21:37:07Z claude-opus-4-5 pi 1d99c2538a0d8fdd80fa468fa402f63479ef2522e83745a0a46527a86238aeb2 reference/device-models.md 15

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

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

该映射以 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 文件:
IOS_COMMIT="<commit sha for ios-device-identifiers.json>"
MAC_COMMIT="<commit sha for mac-device-identifiers.json>"

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
  1. 确保 apps/macos/Sources/OpenClaw/Resources/DeviceModels/LICENSE.apple-device-identifiers.txt 仍与上游一致(如果上游许可证发生变更,请替换该文件)。
  2. 验证 macOS 应用能够正常构建(无警告):
swift build --package-path apps/macos