iOS远程真机之iOS开发的另类神器:libimobiledevice协议库

10 篇文章 70 订阅 ¥9.90 ¥99.00

       官方github地址:https://github.com/libimobiledevice/libimobiledevice

快速直接安装libmobiledevice的方法

       在MacOS下安装可以使用brew,类似Ubuntu中的apt-get

sudo brew update
sudo brew install libimobiledevice
#libimobiledevice中并不包含ipa的安装命令,所以还需要安装
sudo brew install ideviceinstaller

常用功能

安装ipa包,卸载应用
//命令安装一个ipa文件到手机上,如果是企业签名的,非越狱机器也可以直接安装了。
ideviceinstaller -i xxx.ipa
//命令卸载应用,需要知道此应用的bundleID
ideviceinstaller -U [bundleID]
查看系统日志
idevicesyslog
查看当前已连接的设备的UUID
idevice_id --list

截图

idevicescreenshot
查看设备信息
ideviceinfo
获取设备时间
idevicedate
设置代理(也好像是端口转发的工具,具体能利用它干啥还没试过)
iproxy
挂载DeveloperDiskImage,用于调试
ideviceimagemounter
获取设备名称
idevicename
调试程序(需要预先挂载DeveloperImage)
idevicedebug
查看和操作设备的描述文件
ideviceprovision list
ideviceinstaller安装ipa报错
"Could not connect to lockdownd. Exiting."

       http://stackoverflow.com/questions/39035415/ideviceinstaller-fails-with-could-not-connect-to-lockdownd-exiting

The best solution here is to get the latest libimobiledevice, which has a fix for this particular issue:

brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install ideviceinstaller
brew link --overwrite ideviceinstaller

挂载文件系统工具:ifuse

       ifuse是一个依赖libimobiledevice库的工具,所以必须首先安装libimobiledevice

       首先去 https://osxfuse.github.io/ 下载fuse for mac os的库。

       然后github上clone下载ifuse最新源码到本地(自己决定放哪):

       cd 到要安装的目标路径

       然后:

git clone https://github.com/libimobiledevice/ifuse.git

       进入clone好的目录,执行:

//将源码在本机编译:
./autogen.sh
./configure
make

//执行脚本ifuse到系统终端(其实也可以不用,直接去src中运行也可以)
sudo make install
挂载媒体文件目录:
ifuse [挂载点]

       注意,此处的挂载点必须要真实存在,需要预先创建好目录,否则挂载失败

挂载某应用的documents目录
ifuse --documents [要挂载的应用的bundleID]

       注意,iOS 8.3之后要求应用的UIFileSharingEnabled权限要开启,否则可能没有权限访问,会有如下的错误提示:

ERROR: InstallationLookupFailed
The App ‘com.wsgh.test’ is either not present on the device, or the ‘UIFileSharingEnabled’ key is not set in its Info.plist.
Starting with iOS 8.3 this key is mandatory to allow access to an app’s Documents folder.

挂载某应用的整个沙盒目录
ifuse --container [要挂载的应用的bundleID]
获取bundleID
ideviceinstaller -l
卸载挂载点
fusermount -u [挂载点]

       如果是越狱的设备,并且配置好了,可以使用下面命令挂载整个iphone文件系统(暂时没试过,还没有开始研究越狱设备)

ifuse --root [挂载点]

       详细说明,可以进入ifuse的github主页查看原版文档

       https://github.com/libimobiledevice/ifuse

       转自:http://www.jianshu.com/p/6423610d3293

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值