[转]在 Mac OS X上编译 libimobiledevice 的方法

时间:2021-12-02 08:58:58

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. 创建外网 ext_net - 每天5分钟玩转 OpenStack(104)

    虽然外部网络是已经存在的网络,但我们还是需要在 Neutron 中定义外部网络的对象,这样 router 才知道如何将租户网络和外部网络连接起来. 上一节我们已经为创建外部网络配置了ML2,本节将通过 ...

  2. IOS 键盘 禁止输入字母

    在开发中有时候需要数字键盘,但是设置textfield为默认数字键后, 在模拟器上如果用电脑键盘仍然可以输入字母, 在真机上如果使用搜狗等其他输入法也可能会出现可以输入字母的情况.解决方法如下,在te ...

  3. HTML页引用CSS

    方法1 使用import 方法引用CSS <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"&g ...

  4. Java基础之线程——管理线程同步代码块(BankOperation4)

    控制台程序. 除了同步类对象的方法之外,还可以把程序中的语句或代码块制定为synchronized,这种方式更强大,因为可以指定哪个对象从语句或代码块的同步中获益,而不像同步方法那样仅仅是包含代码的对 ...

  5. CORTEX -M3 &colon; Registers in depth

    http://www.zembedded.com/cortex-m3-registers-in-depth/ Thanks for the overwhelm response you show in ...

  6. 1&period;6建造者模式&lpar;生成器模式&rpar; Builder

    1.概念:将一个复杂对象的构建和他的表示分离,使得同样的构件可以创建不同的表示. 2.实例:肯德基和中餐,肯德基抽象了整个做菜的复杂过程(相同的构建),然后在不同的店铺进行实现(不同的表示).中餐往往 ...

  7. HDOJ&lpar;HDU&rpar; 2093 考试排名&lpar;Arrays&period;sort排序、类的应用&rpar;

    Problem Description C++编程考试使用的实时提交系统,具有即时获得成绩排名的特点.它的功能是怎么实现的呢? 我们做好了题目的解答,提交之后,要么"AC",要么错 ...

  8. UNIX环境高级编程——信号

    一.信号生命周期 从信号发送到信号处理函数的执行完毕. 对于一个完整的信号生命周期(从信号发送到相应的处理函数执行完毕)来说,可以分为三个重要的阶段,这三个阶段由四个重要事件来刻画:信号诞生:信号在进 ...

  9. centos7安装telnet

    yum list |grep telnet yum install telnet.x86_64 安装后再测试

  10. Android-事件分发机制框架概述

    http://www.jianshu.com/p/e99b5e8bd67b http://blog.csdn.net/guolin_blog/article/details/9097463 https ...