簡介
A library to communicate with services of Apple iOS devices using native
protocols.
1、打印app列表
ideviceinstaller -l
2、查看當前已連接的設備的UUID
idevice_id -l
3、獲取設備信息
ideviceinfo
4、獲取設備時間
idevicedate
5、重啟設備
idevicediagnostics restart
6、安裝ipa包,卸載應用
ideviceinstaller -i xxx.ipa //命令安裝一個ipa文件到手機上,如果是企業簽名的,非越獄機器也可以直接安裝了。
ideviceinstaller -U [bundleID] //命令卸載應用,需要知道此應用的bundleID
7、查看系統日志
idevicesyslog //屏幕上即可看見手機上所有的日志 idevicesyslog >> iphone.log & //該命令是將日志導入到iphone.log這個文件,並且是在后台執行。 //然后用tail -f和grep查看log tail -f iphone.log tail -f iphone.log | grep 'WeChat’ # 查看包含WeChat的行
8、截圖
idevicescreenshot //如果在使用截圖的時候出現報錯信息,那么就去把相應版本的DeveloperDiskImage的兩個文件復制到libimobiledevice文件下面。 路徑: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/對應版本/ 獲取版本號命令: ideviceinfo -k ProductVersion 安裝DeveloperDiskImage命令: ideviceimagemounter DeveloperDiskImage.dmg //然后就可以正常截圖了
9、 遇到報錯
解決方法:卸載重裝 brew uninstall ideviceinstaller brew uninstall libimobiledevice brew install --HEAD libimobiledevice brew install ideviceinstaller
以上