linux 上 libimobiledevice安装 & 连接设备

打开ubuntu,“ctrl+alt+T”打开终端

准备环境

sudo apt-get install build-essential automake autoconf git cmake pkg-config libtool

安装libplist

sudo apt-get install libxml2-dev python-dev python-pip
sudo pip install cython
git clone https://github.com/libimobiledevice/libplist.git
cd libplist
./autogen.sh
make
sudo make install

安装libusbmuxd

git clone https://github.com/libimobiledevice/libusbmuxd.git
cd libusbmuxd
./autogen.sh
make
sudo make install
安装libimobiledevice
git clone https://github.com/libimobiledevice/libimobiledevice.git
cd libimobiledevice
./autogen.sh
make
sudo make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

安装usbmuxd

sudo apt-get install libusb-dev libusb-1.0-0-dev
git clone http://git.sukimashita.com/usbmuxd.git
cd usbmuxd
./autogen.sh
make
sudo make install

安装ideviceinstaller

sudo apt-get install libzip-dev
git clone https://github.com/libimobiledevice/ideviceinstaller.git
cd ideviceinstaller
./autogen.sh
make
sudo make install
注意:
1.第二行git没安装的要先sudo apt-get install git
2. ./autogen.sh执行完一堆not found先:
	sudo apt-get install autoconf
	sudo apt-get install automake
	sudo apt-get install libtool

安装ifuse

sudo apt-get install libfuse-dev
git clone https://github.com/libimobiledevice/ifuse.git
cd ifuse
./autogen.sh
make
sudo make install

1.设置lockdown权限,iOS7以上的系统通过lockdown管理和iOS设备之间的派对(通过idevicepair命令):

$sudo chmod 0777 -R /var/lib/lockdown/

2.建立新的挂载目录,并且设置正确的用户属性和权限,不然挂载时会出现没有权限,或者操作类型不支持等各种问题,导致失败。

$sudo mkdir -p /media/iphone
$sudo chown $USER:$USER /media/iphone -R
$sudo chmod 0777 /media/iphone

3.验证
通过USB连接设备和Ubuntu,手机端弹出是否信任对话框时,选择 信任
所有请求手机端有应答的操作都必须保持手机处于解锁状态

配对设备(不成功的根据提示进行安装即可):

$idevicepair pair
SUCCESS: Paired with device 94062c249078ef7931bf08ee83a2ba730bc7e352

挂载iPhone(无任何错误信息,说明挂载成功):

$ifuse /media/iphone

使用结束后,记得通过下面命令解除挂载:

$fusermount -u /media/iphone

4.控制设备常用命令:
idevicediagnostics:

休眠: idevicediagnostics sleep
关机: idevicediagnostics shutdown
重启: idevicediagnostics restart

ideviceinstaller:
linux 上 libimobiledevice安装 & 连接设备_第1张图片

显示日志:idevicesyslog(ctrl+c退出)

参考

编译安装libimobiledevice:https://www.jianshu.com/p/31de4b15b347
./autogen.sh: autoreconf: not found的错误解决:https://blog.csdn.net/xiaopang1122/article/details/80733660
使用libimobiledevice在linux上挂载iphone6:https://blog.csdn.net/fengzei886/article/details/53380009

你可能感兴趣的:(软件测试)