当iOS设备连接到计算机时,有没有办法从终端获取电池电量?我查过ioreg,它只显示我的macbook的电池。
发布于 2018-09-30 02:15:27
最近,我使用来自Homebrew的libimobiledevice公式在macOS 10.14.2中获得了这些信息。您可能需要使用最新版本的库,因此将--HEAD附加到安装命令:
$ brew install --HEAD libimobiledevice在此之后,尝试以下命令:
$ idevice_id --list
<UDID>
$ ideviceinfo -u <UDID> --simple
DeviceName: foo's phone
HardwareModel: D22AP
ProductName: iPhone OS
ProductType: iPhone10,3
ProductVersion: 12.0
$ ideviceinfo -u <UDID> --domain com.apple.mobile.battery
BatteryCurrentCapacity: 43
BatteryIsCharging: true
ExternalChargeCapable: true
ExternalConnected: true
FullyCharged: false
GasGaugeCapability: true
HasBattery: true有关更多信息,请参阅。尝试使用ideviceinfo --help列出您可以查询的其他域。
发布于 2018-04-21 03:35:48
您可以使用命令"cfgutil get batteryCurrentCapacity",您可以通过安装Apple Configurator的命令行工具来获取cfgutil。
发布于 2016-02-10 00:51:43
这似乎可以通过SSH来实现
http://iphonedevwiki.net/index.php/SSH_Over_USB
然后使用以下命令:
https://stackoverflow.com/questions/35297388
复制相似问题