How to run fat binaries on iOS 5.1 / iPhone 4

1

I am developing an application for jailbroken iOS devices.
I'd like to target booth iPhone 3G (iOS 4.3.x) and iPhone 4/4S (iOS 5.x)

I successfully generated fat binaries with Xcode 4.3.x

marsu:LatestBuild sst$ otool -h myproduct.armv6
myproduct.armv6 (architecture armv7):
Mach header
   magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
   0xfeedface      12          9  0x00          2    20       2664 0x00200085
myproduct.armv6 (architecture armv6):
Mach header
   magic cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
   0xfeedface      12          6  0x00          2    19       2648 0x00000085

Running this on an iPhone 3G is OK Running this on an iPhone 4, I received

iPhone:~ root# ./myproduct.armv6
Killed: 9

While running the armv7 only build on the iPhone 4 is OK.

What am I missing ?

objective-c
ios
jailbreak
armv7
armv6

1 Answer

1

PARTIALLY SOLVED :

Problem is that ldid can not sign fat binaries. See Building for Jailbroken devices on iOS SDK 4.2 for details.

I found this ldid source code that is supposed to sign fat binaries https://github.com/rpetrich/ldid but it does nor work for me (ldid hangs at runtime)

Solution probably is to use lipo tool to split the binary in two executables, ldid them separately and reassemble into one executable. (doesn't work for me either but I am working on it)

cd MyApp.app/; 
lipo MyApp -extract armv6 -output MyApp6; 
lipo MyApp -extract armv7 -output MyApp7; 
ldid -S MyApp6; ldid -S MyApp7; 
lipo -create MyApp6 MyApp7 -output MyApp
answered on Stack Overflow Mar 29, 2012 by Sébastien Stormacq • edited May 23, 2017 by Community

User contributions licensed under CC BY-SA 3.0