RPC and API
裝置型號資料庫
macOS 伴隨應用程式的 執行個體 UI 會將 Apple 機型識別碼對應為易於理解的名稱(iPad16,6 -> “iPad Pro 13 吋 (M4)”、Mac16,6 -> “MacBook Pro (14 吋, 2024)”)。DeviceModelCatalog 也會使用識別碼前綴(若無法使用則改用裝置系列),為每個裝置選擇 SF Symbol。
apps/macos/Sources/OpenClaw/Resources/DeviceModels/ 中的檔案:
| 檔案 | 用途 |
|---|---|
ios-device-identifiers.json |
iOS/iPadOS 識別碼 -> 名稱對應 |
mac-device-identifiers.json |
Mac 識別碼 -> 名稱對應 |
NOTICE.md |
固定的上游提交 SHA |
LICENSE.apple-device-identifiers.txt |
上游 MIT 授權條款 |
資料來源
內建自採用 MIT 授權的 kyle-seongwoo-jun/apple-device-identifiers GitHub 儲存庫。JSON 檔案會固定至 NOTICE.md 中記錄的提交 SHA,以確保建置結果具有確定性。
更新資料庫
- 選擇要固定的上游提交 SHA(iOS 與 macOS 各一個)。
- 使用新的 SHA 更新
apps/macos/Sources/OpenClaw/Resources/DeviceModels/NOTICE.md。 - 重新下載固定至這些提交的 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- 確認
LICENSE.apple-device-identifiers.txt仍與上游一致;若上游授權條款有所變更,請予以替換。 - 確認 macOS 應用程式能順利建置:
swift build --package-path apps/macos相關內容
Was this useful?