从“macos system_profiler 命令”输出中获取设备类型令牌、USB 闪存驱动器、鼠标

问题描述

我需要获取到 macos 的已连接令牌列表。我使用 system_profiler 命令并返回令牌。但是我如何区分“Rutoken ECP”和“VMware Virtual USB Keyboard”。我看不到任何指向设备类型(令牌、鼠标、键盘等)的属性。 我不想解析“_name”属性获取设备类型。 我可以使用其他命令吗?

system_profiler -json SPUSBDataType -detailLevel full

"_items" : [
            {
              "_name" : "Rutoken ECP","bcd_device" : "1.00","bus_power" : "500","bus_power_used" : "100","device_speed" : "full_speed","extra_current_used" : "0","location_id" : "0x00220000 / 4","manufacturer" : "Aktiv","product_id" : "0x0030","vendor_id" : "0x0a89"
            },{
              "_name" : "VMware Virtual USB Keyboard","bus_power_used" : "0","location_id" : "0x00210000 / 3","manufacturer" : "VMware","product_id" : "0x020b","vendor_id" : "apple_vendor_id"
            }
          ]

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)