主题
MacOsDeviceInfo 继承自: DeviceInfo
macOS 主机的设备信息快照。
当当前平台为 macOS 时,由 get_device_info 返回。包含从原生系统 API 收集的 CPU、内存、机型以及操作系统版本等字段。
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
active_cpus | int | required | Number of active CPUs. |
arch | str | required | Machine CPU architecture. Note: Apple Silicon Macs can return "x86_64" if app runs via Rosetta. |
computer_name | str | required | Name given to the local machine. |
cpu_frequency | int | required | Device CPU frequency. |
host_name | str | required | Operating system type. |
kernel_version | str | required | Machine kernel version. Examples: - "Darwin Kernel Version 15.3.0: Thu Dec 10 18:40:58 PST 2015; root:xnu-3248.30.4~1/RELEASE_X86_64" - "Darwin Kernel Version 15.0.0: Wed Dec 9 22:19:38 PST 2015; root:xnu-3248.31.3~2/RELEASE_ARM64_S8000" |
major_version | int | required | The major release number, such as 10 in version 10.9.3. |
memory_size | int | required | Machine's memory size. |
minor_version | int | required | The minor release number, such as 9 in version 10.9.3. |
model | str | required | Device model identifier. For example: "MacBookPro18,3", "Mac16,2". |
model_name | str | required | Device model name. For example: "MacBook Pro (16-inch, 2021)", "iMac (24-inch, 2024)". |
os_release | str | required | Operating system release number. |
patch_version | int | required | The update release number, such as 3 in version 10.9.3. |
system_guid | Optional[str] | None | Device GUID. |
locales | list[Locale] | required | The full system-reported supported locales of the device. This establishes the language and formatting conventions that application should, if possible, use to render their user interface. The list is ordered in order of priority, with lower-indexed locales being preferred over higher-indexed ones. The first element is the primary locale. The on_locale_change event is called whenever this value changes. |