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

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.

Related

Upgrading iOS SDK

I've XCode 3.2.3 with iOS SDK 4 installed in my iMac. I bought an iPhone 4 with OS version 4.0.2 and I would like to use that device for development. However the Organizer shows the message below when the device is connected.
The version of iPhone OS on “iPhone 4G” does not match any of the versions of iPhone OS supported for development with this installation of the iPhone SDK. Please restore the device to a version of the OS listed below, or update to the latest version of the iPhone SDK.
Currently my XCode supports Base SDK from 3.0 to 4.0.1.
So if I download the latest XCode 3.2.4 with iOS SDk 4.1, will I still have Base SDK support from 3.0 ?
Cheers
Jugs
No, XCode 3.2.4 does not come with SDK 3.0, it comes with SDK 3.2 and 4.1. But you don't need the 3.0 SDK to write apps that will run on 3.0.
There are two versions that are important to you as an iOS developer, and you need to understand them: first, there's SDK version that you link to, this is the Base SDK. It should normally be set to the newest SDK available.
And then, there's the Deployment Target. That is the earliest version your app needs to run on. This is the one you are actually caring about, this one ensures that your app will still run on earlier iOS devices.
To set that, go to "Project -> Edit Active Target". In the dialog, select the "Build" tab, make sure "Show" is set to "All Settings" and the type "deploy" in the search field. Scroll down to the "Deployment" section, the last entry should be "iOS Deployment Target". You need to set this to "iOS 3.0" or whatever suits you. You should now get warnings if you use methods or classes that are not available on 3.0.

Simulate iPhone 3.0 with SDK 4.0

i have xcode 3.1.3 and xcode 3.2.1 installed
For sure now I use 3.2.1 with Sdk 4 to develop new apps.
But what if I like to test a App compiled with sdk 4 on a
simulated iphone that would just have 3.0??
As BaseSDk i use 4.0 and as target 3.0
In xcode 3.1.3 i could select a simulator down to 2.x but with sdk 4.0
i only have the option 4.0 iphone or 3.2 ipad
Example> i know iAd is not supported before 4.0 so I set the
framework to weak. But just to be sure all works fine I really
would like to test my app in a simulator that simulates an iphone with 3.0
thx
chris
The new simulator does not seem to be able to run the old simulator OSs (3.2 being the oldest it'll run). I tried moving them over from old SDK installs and several variations and "no go".
You can check that you aren't using methods defined in the new SDK, when you set the base SDK to 4.0 but set the Deployment to to 3.1.3, for example. For a blog post on how to do this see this blog post, and note my comment on an easier way to do the last two steps (no need to edit the project file as a text file).
inside the iphone sdk dmg file, there should be a folder called packages. in it, you'll find packages like iPhoneSDK3_0 and iPhoneSimulator3_0. Install them to be able to use them in xcode.
Correct me if I'm wrong, but I think a device with 3.0 installed can't even run apps compiled with 3.2 or 4.0. Furthermore, Apple now only accepts iPhone apps (including updates of existing apps) linked against the 4.0 libraries, which won't run on OS version 3.0 devices.
So why do you want to test your app on a 3.0 device?
Try setting the architecture you want to build for in the Xcode project preferences and rebuilding.
If this doesn't work, completely uninstall Xcode and downgrade. You have to completely uninstall because your system must have updated the frameworks for 4.0.
Hope this helps

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

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

Building and Installing to ios 3.2

I recently installed the latest version of xcode with support for ios 4. Unfortunately when I tried to compile and install my app (which I have successfully compiled many times) for my iPod touch (first generation) I get the error that the target I have set requires ios 3.2 and above. I have looked around for a 3.2 update but have not been able to come up with anything. iTines claims my iPod is up to date with ios 3.1.3. My question is, does ios 3.2 exist or, how do I target my first gen iPodtouch to work with with the latest version of xcode?
iOS 3.2 is only for the iPad.
Click on your project name and hit get info. Then select the build tab. Set the iPhone OS Deployment Target to 3.1.3
No-one else has pointed out that you need to select the 4.0 SDK in addition to setting the deployment target. It took me a while to grok that.

How to make my iPhone app compatible with iOS 4?

My iphoneos 3.1 based application is not working on iOS 4 GM: the camera is not showing in full screen, it doesn't correctly detects compass information, the uiwebviews doesn't respond to touches (they don't scroll), and so on. It's completely broken! Now my question is: how can I develop an update using the latest xcode with support for ios 4? The latest iOS 4 xcode (3.2.3) doesn't provide any way to develop for iPhoneOS 3.x ("base sdk missing"). By the other side, xcode 3.2.2 would not allow me to debug it on a iOS 4 device, so I can't test it.
In Xcode, you can use a later base SDK while targeting an earlier version.
Go into your project settings and set iPhone OS Deployment Target to an earlier version, such as "iPhone OS 3.1".
I would create a second disk partition and install the 4.0 version of xcode on that. Keep the 3.2 version on your primary drive.
Its probably not necessary to create a second disk partition but it was simple to do.
Install the 4.0 sdk under a different folder and then re-install the 3.2 sdk and develop in that.