link: http://blog.boceto.fr/2012/05/05/libimobiledevice-for-macosx/

The objective of the day: Compiler libimobiledevice for macosx.

The objective is to be able to deploy the apps generated with jembe directly to your iphone or ipad without using itunes.

I will describe the whole compilation process. If you are only interested on the binary, go directly to the download section

I already write some post here to explain how to create the cross compiler and use it. I also write about the issues on compiling the dependencies. If you need to redo all the work, you can read these posts:

Start downloading the sources here.

Then, while trying to compile libimobiledevice, there are some more issues. So I go for the simplest solution:

  • Do not compile python binding (–without-cython)
  • configure complains on largefile ?! (–disable-largfile)
  • An issue with malloc and realloc! (ac_cv_func_realloc_0_nonnull and ac_cv_func_malloc_0_null)
  • A linker issue with inline function debug_buffer (You will have to remove the inline directive)
Then, everything should work ;)
1
2
3
export ac_cv_func_realloc_0_nonnull=yes
export ac_cv_func_malloc_0_nonnull=yes
PKG_CONFIG_PATH=/home/benoit/workspace/imobiledevice/binary/mac/lib/pkgconfig/ ../configure --host=i386-apple-darwin --target=i386-apple-darwin --prefix=/home/benoit/workspace/imobiledevice/binary/mac/ --without-cython --disable-largefile

Great… We already have some very interesting tools like idevicesyslog. But we also need the installer.
So download the ideviceinstaller sources and just compile. I don’t had any issue here.

You can test the binary here. It works fine, but you have to define the DYLD_LIBRARY_PATH to use it, because all links are absolute by default. You can view the problem using otool utility:

1
2
3
4
5
6
7
8
9
10
11
$ /opt/compiler/mac/bin/i386-apple-darwin-otool -L bin/ideviceinstaller
bin/ideviceinstaller:
 /home/benoit/workspace/imobiledevice/binary/mac/lib/libimobiledevice.3.dylib (compatibility version 4.0.0, current version 4.1.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11)
 /home/benoit/workspace/imobiledevice/usbmuxd/build/libusbmuxd/libusbmuxd.2.dylib (compatibility version 2.0.0, current version 1.0.8)
 /usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
 /usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
 /home/benoit/workspace/imobiledevice/libplist/build/src/libplist.1.dylib (compatibility version 1.0.0, current version 1.1.8)
 /home/benoit/workspace/imobiledevice/binary/mac/lib/libzip.2.dylib (compatibility version 4.0.0, current version 4.0.0)
 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
 /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

So you will have to use install_name_tool to update the links. For exemple:

1
$ /opt/compiler/mac/bin/i386-apple-darwin-install_name_tool -change /home/benoit/workspace/imobiledevice/binary/mac/lib/libimobiledevice.3.dylib @executable_path/../lib/libimobiledevice.3.dylib bin/ideviceinstaller

At the end, you should have:

1
2
3
4
5
6
7
8
9
10
$ /opt/compiler/mac/bin/i386-apple-darwin-otool -L bin/ideviceinstaller bin/ideviceinstaller:
 @executable_path/../lib/libimobiledevice.3.dylib (compatibility version 4.0.0, current version 4.1.0)
 /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.3.11)
 @executable_path/../lib/libusbmuxd.2.dylib (compatibility version 2.0.0, current version 1.0.8)
 /usr/lib/libssl.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
 /usr/lib/libcrypto.0.9.7.dylib (compatibility version 0.9.7, current version 0.9.7)
 /home/benoit/workspace/imobiledevice/libplist/build/src/libplist.1.dylib (compatibility version 1.0.0, current version 1.1.8)
 @executable_path/../lib/libzip.2.dylib (compatibility version 4.0.0, current version 4.0.0)
 /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.3)
 /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)

That all. Download the imobiledevice binary!

[转]在 Mac OS X上编译 libimobiledevice 的方法的更多相关文章

  1. Mac OS X 上Lua的安装方法

    先在Mac OS的终端查询下本机是否已安装Lua Last login: Thu Jul 10 07:54:48 on ttys000 keshans-Mac-mini:~ keshan$ lua - ...

  2. Mac OS X上尝试编译CoreCLR源代码

    CoreCLR登陆GitHub之后,体验CoreCLR首当其冲的方式就是在自己的电脑上编译它,昨天分别在Windows与Linux上成功编译了CoreCLR,详见: 1)Windows上成功编译Cor ...

  3. 在Mac OS X上用自己编译出的CoreCLR运行.NET程序

    当昨天被Mac OS X上无法编译CoreCLR的问题困扰时(详见Mac OS X上尝试编译CoreCLR源代码),后来发现这个难题竟然被神人@kangaroo给解决了,连CoreCLR的微软开发人员 ...

  4. 如何在Mac OS X上安装 Ruby运行环境

    对于新入门的开发者,如何安装 Ruby和Ruby Gems 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境.此安装方法同样适用于产品环境! 系统需求 首先确定操 ...

  5. Mac OS X上用CoreCLR运行一个真正的.NET控制台程序

    这个真正的控制台程序来自corefxlab,名叫CoreClrHelloWorld,是一个跨平台的.NET控制台演示程序,可以显示微软.Linux.苹果的logo. CoreClrHelloWorld ...

  6. Mac OS X上安装 Ruby运行环境

    环境   对于新入门的开发者,如何安装 Ruby和Ruby Gems 的运行环境可能会是个问题,本页主要介绍如何用一条靠谱的路子快速安装 Ruby 开发环境.此安装方法同样适用于产品环境! 系统需求 ...

  7. Sqlite在Windows、Linux 和 Mac OS X 上的安装过程

    一:在 Windows 上安装 SQLite 1,下载 请访问SQLite下载页面http://www.sqlite.org/download.html,从Windows 区下载预编译的二进制文件.需 ...

  8. Mac OS X上使用Wireshark抓包

    Wireshark针对UNIX Like系统的GUI发行版界面采用的是X Window(1987年更改X版本到X11).Mac OS X在Mountain Lion之后放弃X11,取而代之的是开源的X ...

  9. Mac OS X 上安装 ASP.NET 5

    在Mac OS X Yosemite 10.10.3 中搭建第一个 ASP.NET 5 Web 项目 终于有时间在 Mac 上安装一下 ASP.NET 5,网上有许多教程,但是多数的时间比较早了,版本 ...

随机推荐

  1. ACM算法

      一.数论算法 1.求两数的最大公约数 2.求两数的最小公倍数 3.素数的求法 A.小范围内判断一个数是否为质数: B.判断longint范围内的数是否为素数(包含求50000以内的素数表): 二. ...

  2. Oracle表空间及分区表

    (1) 表空间及分区表的概念表空间: 是一个或多个数据文件的集合,所有的数据对象都存放在指定的表空间中,但主要存放的是表, 所以称作表空间.分区表: 当表中的数据量不断增大,查询数据的速度就会变慢,应 ...

  3. Ubuntu中编译链接Opencv应用的简便方式

    安装完毕Opencv后,使用下面命令查 看编译/连接參数 pkg-config --cflags --libs opencv 可看到例如以下信息 -I/usr/include/opencv  /usr ...

  4. C语言星号的秘密

    C语言星号的秘密 星号的秘密 1.乘法运算符   2.定义指针 int *p = 0; 还是 int* p = 0;? 后一种比较容易这样理解:定义了一个变量p,它是指针型的(更详细一点,是指向int ...

  5. 使用myeclipse创建带注解的model实体类

    1.先新建JPA项目: 如果没有就点击左下角的Show All Wizards. 点两次Next后,点击Finish即可,中间不用任何操作 (点第二次Next后会出现连接到所在数据库,先不管)     ...

  6. 【Hibernate步步为营】--映射合集汇总

    前几篇文章具体讨论了对象模型到关系模型的转化方法,对映射关系做了具体的了解,Hibernate将对象模型转化为对应的关系模型是通过使用对应的映射来完毕的(相同也能够使用注解),对于对象之间的关系的转化 ...

  7. SQL2005性能分析一些细节功能你是否有用到?

    原文:SQL2005性能分析一些细节功能你是否有用到? 我相信很多朋友对现在越来越大的数据量而感到苦恼,可是总要面对现实啊,包括本人在内的数据库菜鸟们在开发B/S程序时,往往只会关心自己的数据是否正确 ...

  8. 我的MYSQL学习心得(八)

    原文:我的MYSQL学习心得(八) 我的MYSQL学习心得(八) 我的MYSQL学习心得(一) 我的MYSQL学习心得(二) 我的MYSQL学习心得(三) 我的MYSQL学习心得(四) 我的MYSQL ...

  9. HDU 4791 & ZOJ 3726 Alice's Print Service (数学 打表)

    题目链接: HDU:http://acm.hdu.edu.cn/showproblem.php?pid=4791 ZJU:http://acm.zju.edu.cn/onlinejudge/showP ...

  10. struts2 通配符简化配置

    在struts映射中反复出现的模式 动作方法 描写叙述 下一个动作方法 add 为save准备网页 save save 提交INSERT list edit 为update准备网页 update up ...