iOS远程真机之OS X EI Captian 编译 libimobiledevice 错误记录以及解决方法!!

来源:互联网 发布:室内分布设计软件 编辑:程序博客网 时间:2024/05/21 20:25

       iOS Crash日志获取工具 idevicecrashreport 功能优化

       使用idevicecrashreport 处理crash报告,下载优化后的libimobiledevice

       然后重新编译libimobiledevice

1、初次尝试

libimobiledevice-master xiatian$ ./autogen.sh [--enable-static 静态编译]....checking for pkg-config... /usr/local/bin/pkg-configchecking pkg-config is at least version 0.9.0... yeschecking for libusbmuxd... noconfigure: error: Package requirements (libusbmuxd >= 1.0.9) were not met:Package 'libxml-2.0', required by 'libplist', not foundConsider adjusting the PKG_CONFIG_PATH environment variable if youinstalled software in a non-standard prefix.Alternatively, you may set the environment variables libusbmuxd_CFLAGSand libusbmuxd_LIBS to avoid the need to call pkg-config.See the pkg-config man page for more details.

       非常遗憾,报错了~~

       首先我确定本机是安装了最新版的libxml2,brew查看一下

libimobiledevice-master xiatian$  ~ brew list libxml2/usr/local/Cellar/libxml2/2.9.4/bin/xml2-config/usr/local/Cellar/libxml2/2.9.4/bin/xmlcatalog/usr/local/Cellar/libxml2/2.9.4/bin/xmllint/usr/local/Cellar/libxml2/2.9.4/include/libxml2/ (47 files)/usr/local/Cellar/libxml2/2.9.4/lib/libxml2.2.dylib/usr/local/Cellar/libxml2/2.9.4/lib/cmake/libxml2/libxml2-config.cmake/usr/local/Cellar/libxml2/2.9.4/lib/pkgconfig/libxml-2.0.pc/usr/local/Cellar/libxml2/2.9.4/lib/ (3 other files)/usr/local/Cellar/libxml2/2.9.4/share/aclocal/libxml.m4/usr/local/Cellar/libxml2/2.9.4/share/doc/ (153 files)/usr/local/Cellar/libxml2/2.9.4/share/gtk-doc/ (55 files)/usr/local/Cellar/libxml2/2.9.4/share/man/ (4 files)

       按照提示设置一下环境变量

libimobiledevice-master xiatian$  export PKG_CONFIG_PATH=/usr/local/Cellar/libxml2/2.9.4/lib/pkgconfig/:$PKG_CONFIG_PATH

       再次执行命令

libimobiledevice-master xiatian$  ./autogen.shConfiguration for libimobiledevice 1.2.1:-------------------------------------------  Install prefix: .........: /usr/local  Debug code ..............: no  Python bindings .........: no  SSL support backend .....: OpenSSL  Now type 'make' to build libimobiledevice 1.2.1,  and then 'make install' for installation.

2、 再次报错

libimobiledevice-master xiatian$  make../src/idevice.h:30:10: fatal error: 'openssl/ssl.h' file not found#include <openssl/ssl.h>         ^1 error generated.make[2]: *** [debug.lo] Error 1make[1]: *** [all-recursive] Error 1make: *** [all] Error 2

这里写图片描述
       在~.bash_profile 加入以下环境变量

$ vi ~/.bash_profile

       然后添加环境变量

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

       保存环境变量

$ source ~/.bash_profile

3、再次执行

libimobiledevice-master xiatian$  make  CCLD     idevicenotificationproxy  CC       idevicecrashreport-idevicecrashreport.o  CCLD     idevicecrashreportMaking all in docsmake[2]: Nothing to be done for `all'.

       顺利编译

4、安装

libimobiledevice-master xiatian$ make installMaking install in common

5、测试一下:

libimobiledevice-master xiatian$ ideviceinfo -k DeviceNamexiatian iPhone6

       搞定收工!!

若在make这一步出现如下错误:

这里写图片描述

Undefined symbols for architecture x86_64:  "_ERR_remove_thread_state", referenced from:      _internal_idevice_deinit in idevice.o      _idevice_connection_enable_ssl in idevice.old: symbol(s) not found for architecture x86_64clang: error: linker command failed with exit code 1 (use -v to see invocation)make[2]: *** [libimobiledevice.la] Error 1make[1]: *** [all-recursive] Error 1make: *** [all] Error 2

       可尝试下面方法:

libimobiledevice-master xiatian$ CFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib ./autogen.sh [--enable-static 静态编译]

       参考文章:

       OS X EI Captian 编译 libimobiledevice 错误记录以及解决方法~~~

       macOS-Sierra编译安装libimobiledevice

阅读全文
1 0
原创粉丝点击