0

I have created a new project for iPhone using Xcode 4, iOS 4.3 SDK. It has just a button in it, nothing else. I am able to install that on my iPhone 4 device. I set "iOS Deployment Target" as "3.0" and trying to install on my iPhone 3.x 3G device using the same Xcode, but it is installing, but when i launch the application, it comes back to device home screen, unable to launch my application on iPhone 3.x devices.

Is it not possible to run any iPhone application which has built with iOS 4.3 SDK, on iPhone 3.x devices?

Please help me.

Getsy
  • 4,887
  • 16
  • 78
  • 139

3 Answers3

0

Try setting your Base SDK to 3.0.

nevan king
  • 112,709
  • 45
  • 203
  • 241
  • This cannot be done and wouldn't help. You always want to build with the latest SDK as your Base SDK, which is separate and distinct from the Target Deployment Platform. There is no problem building with Base SDK of "Latest" (which is 4.3 at the moment) and target deployment platorm 3.0 **as long as** your app does not use APIs not present in earlier versions of iOS. – Mark Granoff May 05 '11 at 15:09
0

The answer to your question is Yes, if your app does not use an API not available on the older iOS version.

My bet would be that your app is failing to launch (or rather, crashing soon after launching) because you are calling a method that does not exist in the iOS 3.x version present on your iPhone 3GS.

Since you have the device, run the app on the device with the debugger and you may be able to tell exactly where it's crashing.

Mark Granoff
  • 16,878
  • 2
  • 59
  • 61
  • As i said above, i just have a UIButton in the viewcontroller, nothing else. But when i install it, its installing on iPhone 3.x device and xcode thrwoing error as "write failed: broken pipe".. and when i launch the app on the device, it crashes when launching. Any idea? – Getsy May 05 '11 at 15:27
  • @Getsy: Have you seen this: http://www.iphonedevsdk.com/forum/iphone-sdk-development/7209-putpkt-write-failed-broken-pipe.html? – Alex May 05 '11 at 15:35
  • I resolved the "Broken pipe" using your help. But application is not launching on iPhone 3.x. – Getsy May 05 '11 at 15:49
  • So now that you can install it on the device, run it on the device using the debugger if you have not already done so. What does the debugger tell you about the crash? If you created this project in Xcode4 using a provided template, the fact that you "only" have a UIButton in the ViewController means nothing. There could be some template code that just doesn't work on whatever version of 3.x is on that phone. What's the debugger say when you try to run the app on that device? – Mark Granoff May 05 '11 at 15:54
  • OK, will check that and update you. One quick question, can i use the same binary which has built with Xcode4,iOS Deployment Target: "3.0", to install on iPhone 4.x devices as well? Can one binary from Appstore for iPhone 3.x and iOS 4.x devices this way? – Getsy May 05 '11 at 16:05
  • I believe so, as long as you build for both arm6 and arm7. The one binary is a universal binary in this case, in that one binary contains the images for each architecture. – Mark Granoff May 05 '11 at 16:26
0

It is possible to run apps created in Xcode 4 on iOS 3.x. You might be using some API method that is only available in iOS 4.0+, and thus when running it on iOS 3.x, it will crash (because that method is unavailable there).

What you should do is check the debug log and see what error the iPhone throws when starting up, or have a look in the device logs: they should show you the stack trace regarding where the problem is.

Alex
  • 7,432
  • 20
  • 75
  • 118
  • OK, I'll try, One quick question, can i build with "iOS Deployment Target" as "3.0", the same binary will work on iOS 4.x devices as well. – Getsy May 05 '11 at 15:51
  • Yes. I think if you are aiming to also allow people with 3.0 versions of iOS, you should set deployment target low (to 3.0). The app should also work on iOS 4.0+. Check out http://stackoverflow.com/questions/3703612/iphone-app-basesdk-and-ios-deployment-target and http://stackoverflow.com/questions/5588309/ios-deployment-target – Alex May 05 '11 at 17:35