How can I add older version of iOS SDK in Xcode 4.5
You need to copy the iPhoneOS5.1.sdk to the directory
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk
and iPhoneSimulator5.1.sdk to
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk
(You'll need to restart Xcode to be able to select the SDKs in the Base SDK build option.)
None of the above worked on my 10.8 xcode 4.5.1. Most of the paths given above are not found.
Here is my solution note.
- Download xcode_4.4.1_6938145.dmg in https://developer.apple.com/downloads/
- Load up the dmg file then go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ you will find iPhoneOS5.1.sdk (this is what i want in this case).
- Copy iPhoneOS5.1.sdk folder into your Xcode folder /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
- Restart Xcode
- Open Xcode project setting->build settings->base SDK, then you will see iOS 5.1 option.
From the terminal, run this command, then restart XCode:
cp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
Note, substitute 'iPhoneOS5.0.sdk' with the name of whatever SDK you're interested in copying.