XCODE Base SDK missing - iphone

The only option I am able to see in my Base SDK is IOS 4.2 but I can see all SDK versions in IOS Deployment Target. I am trying to run a project which was written using IOS 3.2 do able to run the current XCODE settings.
Any clue?

If you don't have anything incompatible between the iOS 3 and iOS 4 APIs, you should be able to compile and run successfully by changing the Base SDK setting on Project - Edit Project settings (Build tab), and Edit Active Target. Those are the two places that make reference to the original SDK you used (3.2), and the two places you should change to reflect your current SDK (4.2).

yes, change base SDK to "latest iOS" or one which is available with your XCode installation; that should work.
deployment target is the OS version on which the app should be able to run, base SDK is the version you compile and test the app with.

Related

XCode 4 - Device does not show up in the schema "destination" dropdown

I can't for the life of me find out how to run applicaitons on a device (specifically, and iPhone 4) using XCode 4.
The documentation says to "Set the run destination to iOS device in the scheme editor and build and run your application."
The dropdown menu in the schema editor only has simulator options.
Could someone present a step-by-step method for running applications on devices using Xcode 4?
Using:
Xcode 4.0.2 (iOS 4.3)
iPhone 4.3.3
UPDATE
I ended up doing a series of restarts (Macbook Pro, iPhone 4, Xcode), did a few cleans and builds of the project, and set the "Base SDK" build attribute for the TARGET to "Latest iOS (iOS 4.3).
After that, the device appeared in the destination drop-down in the scheme editing menu.
(Thank you for your time septi!)
Be sure to Verify the BASE SDK used in your project. From the docs:
"
Note: If you are building to your development device, the Base SDK version number defined on your Xcode project must be greater than or equal to the software version number on your development device; otherwise Xcode cannot initiate a debugging session with the device. In that case, you will need to download and install the latest iOS SDK version that is greater than or equal to your device software version.
"
I had a similar problem. My phone has iOS 4.2.1
I downloaded a sample app and my phone did not show up as an option, only the simulators were listed.
So this is just a configuration issue:
To fix this you need to select the project, and:
(as noted above) Select Build Settings/Base SDK = (in my case) Latest iOS (iOS 4.3)
Select Summary: Devices: iPhone
Select Deployment Target: (in my case) 4.2
Now I get the following in the dropdown list of targets:
Myiphone (4.2.1, overriding Base SDK to 4.3)
Also watch out for the UIRequiredDeviceCapabilities property in the plist file. This can prevent a device from showing up sometimes.
I encountered this today in XCode 5 and tried the steps specified. Eventually, I found another solution that may be of use to future readers (Xcode 4 or otherwise).
Go to your project settings and select your target.
Select the "General" tab and scroll to Deployment Info.
Under "Deployment Target", make sure that your device's OS, or something lower, is specified.
---> Your device should now show up as available for debugging in the listing.
Came across this by checking the same device in another project. In that project, the device was listed just fine. When looking at the project settings between the two, the above difference was what stuck out and resolved the issue.
The "Deployment Target" in the project general settings needs to be <= your device, as Danny said above.
Be aware that when you create a new project in a new version of XCode, the default deployment target will be the latest OS release. If your iPhone is on a lower release, this means you either need to upgrade your iPhone, or install an older SDK into your XCode.
You can install an older SDK by copying it into the XCode package at location:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

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.

Which iPhone SDK should I use?

I have little knowledge about how to make application to compatible to a device.
I have iPhone SDK 4.0 and want my app to run on iOS 2.0 or later.
I have read that set only the iPhone OS Deployment Target to 2.0 and use only those API methods which are common after 2.0.
Is it enough?
or do I have to use another (lower) SDK?
or do I have to do something more...?
You should always be developing with the latest SDK. You can set this in your project's properties under "Base SDK" in the "Architectures" section of your project's settings (right click on the project in the organizer, and go to "Get Info").
However, to make sure that your app runs on older devices, you would do this by setting the "iOS Deployment Target" to iOS 3.0 under the "Deployment" section of the project's settings.
For the record, I said version 3.0 above because that's the lowest possible supported version that I see in my Xcode. I don't think it's possible to target 2.0 devices anymore.
The newest Sdk. Apple may not accept the Sdk create by old Sdk.
You can target your min required version os for your App even you are using latest version Sdk.

Old projects are not running in new iPhone SDK 4.0

I have a UICatlog project downloaded from apple development library. It was running fine with 3.0 Base SDK, but when I upgrade xCode SDK Version 3.2.3. I am getting an error:
error: There is no SDK with the name or path 'iphoneos3.0'
What do I do?
Change the Base SDK setting in the Project Info to iPhone Device 4.0.
Check that you aren't changing the Base SDK for the project and not the current target. The current target base SDK setting will override the project settings. Also, if you wan't to support older platform versions, make sure you set Deployment target appropriately.

Choosing iPhone SDK in latest Xcode: Only 3.0 SDKs are available, but I have 2.0 on disk

After I downloaded the latest Xcode with the 3.1.2 SDK, I can't build and test for 2.2.1 anymore. I have the 2.2.1 SDK in the proper directory of my Developer folder.
Is there a setting I have to change?
Yes, to choose an older SDK in the Active SDK popup you have to set either the Base SDK or the Deployment Target build setting of your target to a value equal to or less than 2.2.1.
The Base SDK expresses your intention of what API your code is written for.
The Deployment Target expresses your intention of the earliest iPhone OS you want your app to run on.
The Active SDK is your build-time choice of SDK to use, usually Device vs. Simulator. But you will fail if you try to build against an SDK that is older than what your code is written for. If you code is indeed written to compile against older SDKs and/or run on older OS versions, you must express this by setting the appropriate build settings in the Target. Otherwise the Active SDK popup will limit you to what it knows will work with your code.
Where are you trying to select it? As the base SDK?
You should always be linking against the newest SDK version (this is what an Apple engineer told me directly at an iphone dev event) and then set your Deployment Target back as far as you want. You should be able to set you iPhone OS Deployment Target back to the older SDK version.
This is because Xcode uses weak linking so it will leave out things from the newer SDK on older versions, you do need to do some conditional checking for specific API's/functions using things like respondsToSelector if you are using functionality that has changed across versions.