工具汇总
libimobiledevice:使用本机协议与 iOS 真机设备上的服务进行通信的开源包
ideviceinstaller:用于管理 iOS 设备上的应用程序和应用程序存档的命令行应用程序
xcrun simctl:Xcode自带,用来管理iOS模拟器的库
instruments:Xcode自带性能测试工具,可利用命令行调用
ios-deploy
libimobiledevice Git地址:https://github.com/libimobiledevice/libimobiledevice
常用命令
idevice_id:查看当前已连接的设备的UUID
idevicesyslog:查看系统日志
idevicescreenshot:生成一张当前已连接设备的截图
idevicedate:获取设备时间
ideviceinfo:查看设备信息,通过-k参数可查找具体的键对值UniqueDeviceID等
ideviceinstaller
Git地址:https://github.com/libimobiledevice/ideviceinstaller
常用命令
ideviceinstaller --list-apps:获取app列表和信息
ideviceinstaller -u [udid] --install [xxx.ipa]:给指定连接的设备安装应用
ideviceinstaller --uninstall [bundle id]:卸载指定应用
xcrun simctl 常用命令
xcrun simctl list:查看设备状态
xcrun simctl boot [UDID]:启动指定设备名称的模拟器
xcrun simctl shutdown [UDID]:关闭指定设备名称的模拟器
xcrun simctl install <uuid> <app路径>:安装APP
xcrun simctl launch <device> <bundle identifier>:启动指定APP
instruments 常用命令
instruments -s devices:获取当前已连接设备
ios-deploy 常用命令
ios-deploy -c # 查看当前链接的设备
ios-deploy --[xxx.app] # 安装APP
ios-deploy --id [udid] --uninstall_only --bundle_id [bundleId] # 卸载应用
ios-deploy --id [udid] --list_bundle_id # 查看所有应用
ios-deploy --id [udid] --exists --bundle_id # 查看应用是否安装
备注:
xcode 13版本后,已废弃 instruments -s devices;采用 xctrace list devices
Instruments -w [UDID] -t "App Launch" -P [bundle id]:指定APP启动instruments进行性能测试,'-t'指定instruments模板,如"App Launch"
运行某个app:idevicedebug run 'APP_BUNDLE_ID'可以直接launch某个app,当然,这个app必须是你通过development证书build到手机上的才行。