Skip to content

MacOsDeviceInfo 继承自: DeviceInfo

macOS 主机的设备信息快照。

当当前平台为 macOS 时,由 get_device_info 返回。包含从原生系统 API 收集的 CPU、内存、机型以及操作系统版本等字段。

属性 ​

名称类型默认值说明
active_cpusintrequiredNumber of active CPUs.
archstrrequiredMachine CPU architecture. Note: Apple Silicon Macs can return "x86_64" if app runs via Rosetta.
computer_namestrrequiredName given to the local machine.
cpu_frequencyintrequiredDevice CPU frequency.
host_namestrrequiredOperating system type.
kernel_versionstrrequiredMachine 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_versionintrequiredThe major release number, such as 10 in version 10.9.3.
memory_sizeintrequiredMachine's memory size.
minor_versionintrequiredThe minor release number, such as 9 in version 10.9.3.
modelstrrequiredDevice model identifier. For example: "MacBookPro18,3", "Mac16,2".
model_namestrrequiredDevice model name. For example: "MacBook Pro (16-inch, 2021)", "iMac (24-inch, 2024)".
os_releasestrrequiredOperating system release number.
patch_versionintrequiredThe update release number, such as 3 in version 10.9.3.
system_guidOptional[str]NoneDevice GUID.
localeslist[Locale]requiredThe 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.

关注我,学习大模型、大数据、Python等热门技术。