Compiling for iOS 3.1.3, using xcode 3.2.3 (and iOS 4 that came with it) - iphone

I've downloaded the final version (and never installed any beta versions before) of xcode 3.2.3 with sdk 4, and now I can't seem to find a way to compile my app for a 3.1.3 iOS.
Does anybody know how can I do that ?

As it is, you can't. They probably did this on purpose to discourage new apps compiled for 3.1.3 which foils multitasking.
Instead you can compile for iOS 4 but make your deployment target 3.1.3. This doesn't really require any more real work, as long as you don't use any non-3.1.3 methods/classes etc. and the application can install and run on a 3.1.3 device. You can also then make your application multitasking aware so that it works nicely on a device that does run iOS 4 and is capable of multitasking.
Just a note: the Base SDK may be set at the project level, but you will need to go to the build settings for the target itself to set the deployment target (that setting is not available at the project level).

To expand on Jason Coco's answer:
If you go to the Project Info screen and click Build, you can choose what Base SDK to use (4.0) and then scroll down to iPhone OS Deployment Target version and set it to 3.1.3 or whatever.
However, you also have to go to the Targets section under Groups & Files (red bullseye) select your target and get the Info build page, and set your iPhone OS Deployment Target there too.
Once that's done, you should be able to test it with a device that's still running 3.0 or whatever you selected.

if you want to be compatible with iPhone OS 3.x you still compile for SDK 4.0, but open target settings and choose that application can run on 3.x (iPhone OS Deployment Target). If you did not use any iOS 4.0 specific APIs then your app will run smoothly on 3.x and 4.x, here is a screenshot of setting to change:
Screenshot

Related

How to target previous version of iOS in XCode4?

How can I target a previous version of iOS in XCode4? My app is building only for iOS 4.3 devices and I'd like users with iOS 3.0 installed to be able to run the app as well.
Select the project in the Project Navigator and the then the target in the detail view. Under the summary tab you have the Deployment Target. Set it to 3.0. Alternatively you can set the iOS Deployment Target in the build settings. Both ways change the same parameter, it's just two different ways to access it.
This will allow your app to run on iOS 3.0 but it's still compiling against SDK 4.3 which is required by Xcode 4. So be careful that you don't use any SDK items that require an OS newer than 3.0 or if you do that they're properly checked with an if statement. These issues can be a bit of a pain since they manifest themselves at runtime.

Base-SDK of v4.0 means it won't install on 4.1 or 4.2 devices?

I was using xCode v3.2.3 and SDK 4.0 to write iPhone apps that worked on my iOS v3.1.3 device... as well as v4.0. (Deployment target set to 3.1.3. Base SDK set to v4.0)
Does that mean everyone that uses my app will need a minimum of iOS 3.1.3 and a maximum of v4.0? Or will they also run on v4.1 and v4.2?
Second part of my question:
I now upgrade my iOS v3.1.3 to v4.2.1.
Xcode now says my v4.2.1 device is now no longer provisioned.
Doesn't a Base-SDK setting of v4.0 mean apps will also run (or at least install) on v4.x?
No. Base SDK just means that your app will be built against the iOS 4.0 libraries. Any 4.x device will be able to run a release build of your app, but for debugging, Base SDK and the iOS version on your device must match. In the end, you need to build your app with the newest available Base SDK anyway, because Apple won't accept apps built for older SDKs into the App Store.
No, they will. iOS has Backward compatibility.
I agree with Irene. I found the solution:
The hint came from here: Can't make Xcode 4 run a barely empty project using SDK 4.2 (runs fine in 4.3)
And this is how i resolve: my xcode 4.0 my SDK 4.3 and my Ipod touch device is 4.2.1 - You see it is backward compatible. There are 2 things you must do in order to resolve. 1) In your xcode 4.0, You click on your project name under Target to ensure you change the target not the Project setting. Find the row >IOS deployment target to the version of your device in my case it was back to 4.2.1 ipodtouch so i set 4.2 (do not worry about basesdk it is for your application not the same as your application's target. 4.3 basesdk requires you provide codesign so you have to select code sign if do not have one apply for one looking up in Apple website or google)
After setting your target to compatible version with your device you now can go to "set the active scheme" that is where you select which device to install and run on including the simulator. So you will find you device there select it and you are good to go.
And if you still can not get it going. You can try to select your project under Project this time adn set the ios deployment target to your version mine was 4.2 ipodtouch ios. Then go select "set the active scheme" that is where you select which device to install and run on including the simulator. So you will find you device there select it and you are good to go.

Is it possible to test my iPhone/iPod application on iOS 3.1.3

When building I am getting this error.
The Info.plist for application at /Users/guest2/Documents/MOYMalpha/build/Debug-iphoneos/MOYMalpha.app specifies a minimum OS version of 4.0, which is too high to be installed on iPod touch
I tried to change the verison in Xcode but minimum verison it is showing for iPhone is of 3.2..so what changes I should do to run in iOS 3.1.3
Leave the Basic SDK setting at 4.x. In the Xcode project, in the Build Settings for the Target, look for the iOS Deployment Target setting. Change that iOS Deployment Target setting to 3.1.3, build and test. The build may or may not work if it uses any APIs above the iOS version level on your test device.

Can a user install iphone application developed using 3.1.3 in his iphone 3.0?

Can a user install my application from iTunesStore if he is having iPhone OS 3.0 or having lower version of iPhone OS and I have developed my application using iPhone SDK 3.1.3...
Can anyone help me with this...
Thanx in advance...
In you projects settings, use a build setting named "iPhone OS Deployment Target" to specify your minimal iPhone OS version.
To do that, double click the blue project icon (at the top of the project’s "Groups and Files" table), click the "Build" tab and find the setting in the "Deployment" settings section.
To use features from a later iPhone OS, see this question.
If you compile your application to target iPhone OS 3.1.3 then it will not run on 3.0 - instead the user will get a message telling them to update their OS when they try to install.
However, there's a good chance that you will be able to compile your app to target 3.0 as long as you're not using any specific 3.1+ and newer features. To do so, just change the Active SDK you target in Xcode before you compile. Then your app will run on both 3.0 and 3.1.3
If you set your Target SDk in Xcode to 3.1.3, you may be using features of the SDK not found on an iPhone running a lower OS. However, you can test for those features in your program and take alternative measures if the user does not have those features/frameworks available. There is nothing that will prevent your app from running on older iPhone OSes, other than the fact that using new features will cause the app to fail.
On the other hand, you use the Deployment SDk value of XCode to limit which iPhone OSes can actually run your app. This way you can limit the app to be available to only iPhones with later OS and not the earlier ones. The Apple iTunes App Store will use the Deployment SDk value to tell the user who is purchasing, what the minimum system requirement is too.

Why is the iPhone Simulator 3.0 not showing up in Xcode?

I have installed the new 3.0 SDK, but when I start up Xcode, I don't see an option to build for "Device - iPhone OS 3.0" or "Simulator - iPhone OS 3.0"
The Xcode About box says I am running: 3.1.2
Is there something else I have to do?
I think you need to upgrade to Xcode 3.1.3. I have the latest version and that's what my About box reads.
If you are sure you downloaded the latest version, perhaps you installed in to a different location?
If you are using an existing project you may have to tell your project to build to the 3.0 targets. I didn't have to do this for any of my projects but ...
Under the Deployment section of your project properties you should see:
iPhone OS Deployment Target - (change this to use iPhone OS 3.0)
You can also check that the Architectures section has the Base SDK set to 3.0.
This happens quite often when downloading Apple's sample code projects which are targeted for iOS 3.x but you've got iOS 4.x.
To show Simulator option go to Project Info window -> General tab -> Base SDK for All Configurations - choose Latest iOS.
If it doesn't appear straight away, close and reopen Xcode.
This is what worked for me:
I clicked on the box (where I expected iPhone Simulator to be shown), right clicked manage scheme. After that deleted all schemes, and in similar way, created a new scheme. It automatically produced all simulators including the ones for devices.