Does Xcode 4.2 support compiling projects for iOS 3.1.3? I tried compiling a project that I'm currently working on, and I keep getting crashes every time I try running the application on an iPhone 3G with iOS 3.1.3. I know that the OS I'm running on is outdated already, but the client required that the application should run on iOS 3.1.3. Any ideas how will I solve this problem?
Compiling for iOS 3.1.3 with Xcode 4.2
1.9k Views Asked by Avenson Robles Navalta AtThere are 2 best solutions below

Here are a whole bunch of things I had to do to make XCode 4 compile for iOS 3.1 AND debug on a 3G iPhone:
Downgrade to XCode 4.3.3.
Xcode 4.5.2 would simply refuse to connect to an iPhone 3G for debugging. The 4.3.3 version happily coexists alongside the 4.5.2, they can even share the same project file, although leaving the armv7s in the architecture settings will generate innocuous warnings in 4.3.3. See below.
Change the project settings
Architecture -> go to "others", remove the line, put armv6 armv7
(you can also add armv7s in the line above for compiling the same project with 4.5.2, but it will generate warnings under 4.3.3)
Valid architecture -> armv6 armv7 armv7s Deployment target -> change to 3.1
In the plist file, in "Required device capabilies", remove armv7.
Change the Target settings (click target on the left pane)
deployment target to 3.1
Edit your Scheme to change the debugger
In the Run section, debug, change debugger to GDB (instead of LLDB)
In the Test section, debug, change debugger to GDB (instead of LLDB)
Change the auto-generated code that will crash an iOS 3.1 app
In your AppDelegate "didFinishLaunchingWithOptions", instead of this line
self.window.rootViewController = self.viewController;
Put this code
if ([self.window respondsToSelector:@selector(setRootViewController:)]) self.window.rootViewController = self.viewController; else [self.window addSubview:self.viewController.view];
And then you should be able to run and debug on a 3G iPhone.
In Build Settings changes following settings:
In *AppDelegate.m
Uh....SORRY... forgot one...