macOS 伴侣应用在 Instances UI 中通过映射 Apple 设备型号标识符(如 iPad16,6、Mac16,6)来显示友好的设备名称。

数据来源

映射数据来自 MIT 许可的开源仓库 kyle-seongwoo-jun/apple-device-identifiers,以 JSON 格式存放于:

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

为保证构建确定性,JSON 文件固定到特定上游 commit(记录在 NOTICE.md 中)。

更新步骤

  1. 确定要固定的上游 commit(iOS 和 macOS 各一个)
  2. 更新 NOTICE.md 中的 commit hash
  3. 重新下载 JSON 文件:
IOS_COMMIT="<commit sha>"
MAC_COMMIT="<commit sha>"
 
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. 确认 LICENSE 文件与上游一致
  2. 验证 macOS 应用构建无警告:swift build --package-path apps/macos

相关页面