1
我需要在Mac OS X中獲得ioreg
的輸出作進一步處理,但是它使用的樹狀結構難以解析?有什麼辦法可以用XML獲取輸出或者更容易解析(如system_profiler
)?是否有可能以更容易解析的格式獲取ioreg的輸出?
+-o Root <class IORegistryEntry, retain 12>
| {
| ...
| }
|
+-o MacBookPro5,1 <class IOPlatformExpertDevice, registered, matched, active, busy 0, retain 25>
| {
| ...
| }
|
+-o AppleACPIPlatformExpert <class AppleACPIPlatformExpert, registered, matched, active, busy 0, retain 51>
| | {
| | ...