c4rt1y

libimobiledevice 使用技巧

0x01 介绍

libimobiledevice是一款苹果调试工具,支持跨平台。

0x02 安装

# 基础信息
brew install --HEAD libimobiledevice
# 安装写在ipa文件
brew install --HEAD ideviceinstaller

PS:如果不加上 –HEAD 选项,安装是老版本,可能新版苹果系统

0x03 使用

# libimobiledevice 使用
## 查看连上的ios
idevice_id -l 

## 获取设备信息
ideviceinfo -u [udid] # 指定设备,获取设备信息
ideviceinfo -u [udid] -k DeviceName # 指定设备,获取设备名称:iPhone6s
idevicename -u [udid] # 指定设备,获取设备名称:iPhone6s
ideviceinfo -u [udid] -k ProductVersion # 指定设备,获取设备版本:10.3.1
ideviceinfo -u [udid] -k ProductType # 指定设备,获取设备类型:iPhone8,1
ideviceinfo -u [udid] -k ProductName # 指定设备,获取设备系统名称:iPhone OS

## 设备操作
idevicediagnostics restart	 # 重启
idevicediagnostics shutdown  # 关机
idevicediagnostics sleep	 # 休眠

## 获取设备时间
idevicedate

## 截图
idevicescreenshot

## 查看日志
idevicesyslog

# ideviceinstaller 使用

ideviceinstaller -l 					# 查看安装的第三方应用
ideviceinstaller -l -o list_user 		# 查看安装的第三方应用
ideviceinstaller -l -o list_system 		# 查看安装的系统应用
ideviceinstaller -l -o list_all 		# 查看安装的系统应用和第三方应用

ideviceinstaller -u -l 					# 指定某个设备进行查看

ideviceinstaller -i xxx.ipa 			# 安装
ideviceinstaller -u [udid] -i [xxx.ipa] # 给指定连接的设备安装应用

ideviceinstaller -U [bundleID] 			# 卸载

0x04 资料来源

https://www.jianshu.com/p/cff879e5ca65
https://www.cnblogs.com/lilip/p/11402447.html
GoTop