Is it possible to install iOS 6 SDK on Xcode 5?

2018-12-31 23:29发布

Xcode 5 has a preferences pane that allow one to download iPhone 6.1 simulator, however I can't find a place where it allows downloading of iOS 6 SDK, thus it is not possible to set the active SDK to iOS 6 when developing with Xcode 5. Is there a workaround that would allow Xcode 5 to install iOS 6 SDK?

EDIT:

Workarounds should no longer be necessary now that Xcode 5 is generally available and allows you to download previous versions of the SDK.

enter image description here

15条回答
大哥的爱人
2楼-- · 2018-12-31 23:42

EDIT: Starting Feb 1, 2014, Apple will no longer accept pre-iOS7 apps for submission to App Store. So while this technique still works, it will not be useful for most readers.


Yes, this is fine. I still build with iOS 4.3 for one project (it's been awhile since we updated; but they still accepted it after iOS 6 came out), and I currently build 10.5 apps with Xcode 5.

See How to point Xcode to an old SDK so it can be used as a "Base SDK"? for details on how to set it up. You can use my fix-xcode script to link everything for you every time you upgrade.

The only trick is getting the old SDKs. If you don't have them, you generally need to download old versions of Xcode (still available on developer.apple.com), open the installer package, and hunt around to find the SDK you need.

SDKs can be found within the installer package at:

Xcode.app/Contents/Developer/Platforms/

查看更多
刘海飞了
3楼-- · 2018-12-31 23:42

The other answers here are correct too, but I find the following steps to be the easiest:

Just download Xcode 4.6.3 from the dev center link that says "Looking for an older version of Xcode?" (currently points here) and mount the dmg.

Then in terminal, copy the SDK files over:

cp -R /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/

Finally, relaunch Xcode and you're done.

查看更多
弹指情弦暗扣
4楼-- · 2018-12-31 23:42

I currently have Xcode 4.6.3 and 5.0 installed. I used the following bash script to link 5.0 to the SDKs in the old version:

platforms_path="$1/Contents/Developer/Platforms";
if [ -d $platforms_path ]; then
    for platform in `ls $platforms_path`
    do
        sudo ln -sf $platforms_path/$platform/Developer/SDKs/* $(xcode-select --print-path)/Platforms/$platform/Developer/SDKs;
    done;
fi;

You just need to supply it with the path to the .app:

./xcode.sh /Applications/Xcode-463.app
查看更多
墨雨无痕
5楼-- · 2018-12-31 23:52

From 1st february Apple will reject app built only for iOS6 or lower. Here is also the official communication from Apple. Better start building for iOS7.

To clarify my statement: If you build for iOS6 or lower, apple will reject your app. If you build for iOS7 AND lower everything is fine, this means:

  1. you must use xcode5
  2. you should deploy on iOS7 at least.

The content of the Apple email is pretty clear at me

"Make sure your apps work seamlessly with the innovative technologies in iOS 7. Starting February 1, new apps and app updates submitted to the App Store must be built with Xcode 5 and iOS 7 SDK."

查看更多
梦醉为红颜
6楼-- · 2018-12-31 23:53
  • Download Xcode 4.6.x from the Apple Dev Center: https://developer.apple.com/downloads/index.action
  • Create a folder called Xcode4 within the Applications folder and drag-n-drop the downloaded dmg there.
  • Open a terminal window

    $sudo cp -R /Applications/Xcode4/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
    
  • You will be prompt to enter a password since you're inside a system folder

  • Open Xcode 5 and you should now see both SDKs
查看更多
伤终究还是伤i
7楼-- · 2018-12-31 23:55

Just to add, you can actually download old versions of the simulator with Xcode 5 itself - just go to preferences and you'll find them under Downloads:

enter image description here

查看更多
登录 后发表回答