How can I add older version of iOS SDK in Xcode 4.5

我们两清 提交于 2019-12-28 03:19:10

问题


I copied the iOS 5.1 SDK here:

Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

But, I still can't choose the base SDK in Xcode. Can anybody help?


回答1:


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.)




回答2:


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.

  1. Download xcode_4.4.1_6938145.dmg in https://developer.apple.com/downloads/
  2. 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).
  3. Copy iPhoneOS5.1.sdk folder into your Xcode folder /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  4. Restart Xcode
  5. Open Xcode project setting->build settings->base SDK, then you will see iOS 5.1 option.



回答3:


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.




回答4:


@benvolioT answer is correct, but you need permission:

sudo cp -r /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/
Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/



回答5:


Old SDK's for the OS and Simulator might be available from these locations using finder.

For OS

/Developer-old/Platforms/iPhoneOS.platform/Developer/SDKs

For Simulator

/Developer-old/Platforms/iPhoneSimulator.platform/Developer/SDKs

Developer-old, you would find it in device volume path.




回答6:


Akhildas' solution worked for me. I was able to build against the 5.1 SDK with XCode 4.5.1. One caveat:

If you drop an SDK from a version of XCode downloaded by a different Apple ID, the App Store will show that you have an update to 4.5.1 (even though you already have it). When you press the update button, it tells you to log in with the other Apple ID.

Strange, I wonder where the account information is buried in the 5.1 SDK?

Also, when I set a base SDK back to iOS 6, it appears you have to restart XCode to recognize that framework.




回答7:


The BEST SOLUTION is to go to the XCode Preferences and to install older versions of iOS simulator / SDK from there, as explained here : https://apple.stackexchange.com/questions/47323/installing-xcode-with-ios-4-3-device-simulator

Hope this helps :)




回答8:


xcode.app > Right Click > Show Package Contents

It will open xcode package contents.

Go to the directory path -

Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs

Now you can see the folder name with ios sdk version. For example : iPhoneOS(sdk-version).sdk



来源:https://stackoverflow.com/questions/12523888/how-can-i-add-older-version-of-ios-sdk-in-xcode-4-5

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!