Xcode 5有一个首选项窗格,允许一个人下载iPhone 6.1模拟器,但我找不到一个地方,它允许下载iOS 6 SDK,因此不可能将活动SDK设置为iOS 6时,用Xcode 5开发。是否存在允许Xcode 5安装iOS 6 SDK的解决方案?
编辑:
既然Xcode 5已经普遍可用,并且允许你下载以前版本的SDK,那么变通方法应该不再是必要的了。
Xcode 5有一个首选项窗格,允许一个人下载iPhone 6.1模拟器,但我找不到一个地方,它允许下载iOS 6 SDK,因此不可能将活动SDK设置为iOS 6时,用Xcode 5开发。是否存在允许Xcode 5安装iOS 6 SDK的解决方案?
编辑:
既然Xcode 5已经普遍可用,并且允许你下载以前版本的SDK,那么变通方法应该不再是必要的了。
当前回答
这里的其他答案也是正确的,但我发现以下步骤是最简单的:
只需从开发中心链接下载Xcode 4.6.3,上面写着“寻找Xcode的旧版本?”(目前点这里)和安装dmg。
然后在终端,复制SDK文件:
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/
最后,重新启动Xcode,你就完成了。
其他回答
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
我目前已经安装了Xcode 4.6.3和5.0。我使用下面的bash脚本将5.0链接到旧版本的sdk:
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;
你只需要为它提供.app的路径:
./xcode.sh /Applications/Xcode-463.app
找到并下载旧的SDK。在这里可以找到旧的sdk。
我已经复制了xcode。app目录为Xcode_4.6.3.app。
现在你可以在两个xcode版本中进行测试和调试。你必须从相应的文件夹中运行它们,或者在桌面上创建快捷方式。从命令行构建时,将参数设置为iPhoneOS6.1而不是iPhoneOS7.0
这在Xcode5和iOS中非常有效。
进入Xcode5的SDK目录。它通常位于:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
向旧SDK添加一个符号链接,如下所示:
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk iPhoneOS6.1.sdk
或者更准确地说,在命令行中,
sudo ln -s /Applications/Xcode_4.6.3.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk
从2月1日起,苹果将拒绝为iOS6或更低版本开发的应用程序。下面是苹果公司的官方信息。最好开始为iOS7开发。
澄清一下我的声明:如果你为iOS6或更低版本开发应用,苹果会拒绝你的应用。 如果你是为iOS7及更低版本开发,那么一切都没问题,这意味着:
您必须使用xcode5 你至少应该在iOS7上进行部署。
我很清楚苹果邮件的内容
“确保你的应用能与创新技术无缝对接 iOS 7。从2月1日开始,新的应用程序和应用程序更新提交到 应用商店必须使用Xcode 5和iOS 7 SDK。”
这里的其他答案也是正确的,但我发现以下步骤是最简单的:
只需从开发中心链接下载Xcode 4.6.3,上面写着“寻找Xcode的旧版本?”(目前点这里)和安装dmg。
然后在终端,复制SDK文件:
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/
最后,重新启动Xcode,你就完成了。