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,那么变通方法应该不再是必要的了。
当前回答
是的,我今天刚刚解决了这个问题。
找到SDK文件,比如iPhoneOS6.1。Sdk,在你或你朋友的 旧的Xcode目录。 复制并放入Xcode 5目录: /应用程序/ xcode /内容/开发/平台/ iPhoneOS.platform /开发/ sdk。
然后你可以像下面这样选择SDK:
希望这对你有所帮助。
其他回答
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
这里的其他答案也是正确的,但我发现以下步骤是最简单的:
只需从开发中心链接下载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,你就完成了。
我下载了XCode 4,并将iOS 6.1 SDK从它带到XCode 5,如其他答案所述。 然后我还安装了iOS 6.1模拟器(它在首选项中可用)。我还在项目设置中将Base SDK切换到iOS 6.1。
在所有这些操作之后,带有6.1基础sdk的项目在iOS 7模拟器中的comp能力模式下运行。
对我来说最简单的解决方法:
Locate an older SDK like for example "iPhoneOS6.1 sdk" in an older version of xcode for example. If you haven't, you can downlad it from Apple Developer server at this address: https://developer.apple.com/downloads/index.action?name=Xcode When you open the xcode.dmg you can find it by opening the Xcode.app (right click and "show contents") and go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1 sdk Simple Copy the folder iPhoneOS6.X sdk and paste it in your xcode.app right click on your xcode.app in Applications folder. Go to Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ Just paste here.
关闭你的xcode应用程序,重新打开它。
要在模拟器上测试iOS 6中的应用程序: -在你的活动场景中选择iOS 6.0即可。
要在iOS 6中构建应用程序,那么你的应用程序的设计将是iOS 7 iPhone上的旧设计: —在“Targets - Base SDK”中选择“iOS6.1”
请注意:当你在你的目标中改变基础SDK时,iOS 7.0将不再可用来构建模拟器!