libimobiledevice 1.2.1编译安装

参考

  • OS X EI Captian 编译 libimobiledevice 错误记录以及解决方法~~~](http://www.dllhook.com/post/169.html)
  • 重新编译libimobiledevice以修复Homebrew版 版本过低无法使用

起因

brew上编译好的老版本1.2.0配合iOS10和Xcode8无法识别设备,只好自己动手编译新版本。
brew install --HEAD libimobiledevice会报distutils的错,所以只能从源码编译了。

步骤

  • clone源码
git clone https://github.com/libimobiledevice/libimobiledevice
  • 卸载旧的libimobiledevice
brew uninstall libimobiledevice
  • 安装配置编译环境
brew install libtool openssl pkg-config libplist make automake

/.bashrc或/.zshrc中配置openssl

export PATH=/usr/local/opt/openssl/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:$LD_LIBRARY_PATH
export CPATH=/usr/local/opt/openssl/include:$LD_LIBRARY_PATH

如果提示找不到-lssl

xcode-select --install
sudo xcode-select --switch /Library/Developer/CommandLineTools
  • 切换到源码目录下执行安装
CFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib ./autogen.sh
make
make install
  • 再试试idevicesyslog
  • 记得还原xcode
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

你可能感兴趣的:(libimobiledevice 1.2.1编译安装)