Thursday, December 08, 2011

Lion + Xcode 4.2 + Unity 3.4 + iPhone 3G = Disaster?

Or: How to make a universal build that also runs on iPhone 3G or 2nd gen iPod Touch with Unity 3.4.2 and Xcode 4.2 on Lion.


No easy task, but with a little help from all over the web, I figured it out...


Step 1 - Unity:

In the Player Settings, choose SDK Version 4.3 (Yes, Xcode 4.2 comes with iOS SDK 5, but don't set this to iOS latest or you'll get a bunch of errors when building...)
Target iOS Version: 3.1.3 (Choosing something lower doesn't work thanks to a bug in Unity)
Target Platform: Universal (more about this later...)
Target Device: iPhone + iPad (just because I want it to run on both) - not sure these matter, as XCode seems to ignore them...


Build and open it in Xcode

Step 2 - XCode:


• Set the Base SDK of the project and the target to iOS 5.0
• On the target, set the Targeted Device Family to iPhone/iPad
• Still on the target, set the iOS Deployment Target to 3.1.2 (Notice: That's below 3.1.3! I use this just because it's the version my 2nd generation iPod Touch is running)

And now for the part that actually makes it run on old armv6 devices:
•Both in the project and on the target, look for Architectures, click on $(ARCHS_STANDARD_32_BIT) and choose Other... from the popup. Hit the plus and add armv6. (More info on here on stackoverflow)

• Select Unity-iPhone > Your Device from the top and Build+Run!


1 comments:

dock said...

Oh awesome, thanks for sharing this! I'm keen to still support iPhone 3G, it's just a pain that there isn't a simpler procedure.