我正在使用ioreg
命令行工具尝试读取计算机(iMac)上可用的传感器信息。特别是,我想读取环境光传感器的当前值。到目前为止,我已经能够通过检索有关传感器的一些常规信息ioreg -f -b -r -c 'AppleLMUController'
。但是值不存在:
+-o AppleLMUController <class AppleLMUController, id 0x1000002d8, registered, matched, active, busy 0 (0 ms), retain 7>
{
"IOProbeScore" = 0
"CFBundleIdentifier" = "com.apple.driver.AppleSMCLMU"
"IOProviderClass" = "IOService"
"IOClass" = "AppleLMUController"
"IOMatchCategory" = "IODefaultMatchCategory"
"IOCFPlugInTypes" = {"0516B563-B15B-11DA-96EB-0014519758EF"="AppleSMCLMU.kext/Contents/PlugIns/AmbientLightSensorHID.plugin"}
"IOGeneralInterest" = "IOCommand is not serializable"
"IONameMatch" = "ACPI0008"
"IOPowerManagement" = {"MaxPowerState"=1,"CurrentPowerState"=1}
"HIDServiceSupport" = Yes
"IONameMatched" = "ACPI0008"
}
我知道有一些工具可以使用IOKit使用C,ObjC等访问此值-但我明确希望使用bash单行代码尝试获取该值。
有没有人能够通过命令行成功完成此操作,如果可以,怎么办?
The domain/default pair of (.../com.apple.BezelServices, dAuto) does not exist