0、准備工作:
使用brew或Mac Ports安裝:libgnutls or openssl、 libplist 、libusb、libusbmuxd
1、下載代碼:
下載地址:https://github.com/libimobiledevice/libimobiledevice
2、編譯、安裝
打開Mac終端,cd到代碼保存目錄,輸入命令
./configure
make
sudo make install
3、使用
第二步編譯成功后,打開終端,輸入:
idevice_id -l
如果返回設備UDID,說明安裝成功!
問題解決:
1、報錯:
“./configure: line 15055: syntax error near unexpected token `libusbmuxd,'
./configure: line 15055: `PKG_CHECK_MODULES(libusbmuxd, libusbmuxd >= 0.1.4)'”
解決方案:參考(http://libiphone.lighthouseapp.com/projects/27916/tickets/233-add-required-pkgm4)拷貝pkg.m4到m4目錄下。
2、報錯:
Requested 'libusbmuxd >= 1.0.8' but version of libusbmuxd is UNKNOWN
解決方案:http://www.libimobiledevice.org/downloads/usbmuxd-1.0.8.tar.bz2 (install first)
3、報錯:
Undefined symbols for architecture x86_64:
"debugbuffer", referenced from:
afcdispatch_packet in afc.o
afcreceive_data in afc.o
afcfile_lock in afc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libimobiledevice.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
解決方案:參考(https://github.com/libimobiledevice/libimobiledevice/issues/10),在https://github.com/libimobiledevice/libimobiledevice鏈接中,下載trustdialog branch代碼。
4、Installing libxml2
下載libxml,地址:ftp://xmlsoft.org/libxml2/
解壓,然后
./configure --with-python=/System/Library/Frameworks/Python.framework/Versions/2.3
/
make
sudo make install