Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Older SDK disappeared after installing new Xcode version

Tags:

xcode

iphone

Why are old SDKs beeing removed when installing a new version of xcode with new Iphone SDK ? Now we have v4, what settings do I have to make in order that the apps still work with 3.x ?

Thanks

like image 729
elementsense Avatar asked Jun 08 '10 18:06

elementsense


4 Answers

Set the Base SDK to 4.0 and Deployment Target to 3.x. Or, in modern conditions, the Base SDK to Latest and Deployment Target to whatever you need.

like image 192
zoul Avatar answered Oct 16 '22 01:10

zoul


Although 'Zoul' has most succinctly answered the question, I shall make an attempt to elaborate on the 2 settings and point to some useful documents which will help others who are new to the situation.

  1. Base SDK Version: This indicates the version of the SDK based on which the program has been compiled. This can be set from the "Build Settings" for the project or target. You can use API code from Apple in your code introduced up-to that version and compiler will know all the symbols and compile without any issues.

  2. Deployment target: This is a declaration from your side about the minimum iOS version which should be installed on the user's device to run your code. This setting can be found under "Info" section for Project and "Summary" section for a particular target. Now, important thing to understand is that your code will not automatically run smoothly on devices with older versions of the iOS if you are using API code introduced in later version by Apple. These can be new classes/methods/frameworks introduced by Apple in later version. You have to ensure by writing necessary conditional code and provide alternate code path to gracefully degrade for older iOS version which does not have the newer API. It is up-to you to handle version incompatibilities.

Apple documentation on the subject can be found in "SDK Compatibility Guide".

To know about the changes with different versions of iOS refer "What's new in iOS".

This topic is also discussed in "iOS Development Guide" under section "Building and Running Application". Refer sub-section "Specifying the Runtime Environment".

like image 43
Vishal Chaudhry Avatar answered Oct 16 '22 01:10

Vishal Chaudhry


If you have backups of your system from something like Time Machine (and you better!) you can copy the older SDKs from the backup located at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs - then just restart XCode and you're ready to go.

like image 3
SaltyNuts Avatar answered Oct 16 '22 01:10

SaltyNuts


If you still have the problem after you set Deployment target at least as low as your desired SDK, then you need to download that SDK. Luckily, Xcode helps us here also:

  • look after Simulator selector in top left of your Xcode and select More Simulators. It will open a page like the one below:

Download SDK view

  • just select the SDK you need to test your app against.
like image 3
Calin Drule Avatar answered Oct 16 '22 01:10

Calin Drule