如何在Xcode 4.5中添加旧版iOS SDK

时间:2022-10-30 13:58:43

I copied the iOS 5.1 SDK here:

我在这里复制了iOS 5.1 SDK:

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

应用程序/ Xcode.app /内容/开发/平台/ iPhoneOS.platform /开发商/软件开发工具包

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

但是,我仍然无法在Xcode中选择基础SDK。有人可以帮忙吗?

7 个解决方案

#1


57  

You need to copy the iPhoneOS5.1.sdk to the directory

您需要将iPhoneOS5.1.sdk复制到该目录

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

and iPhoneSimulator5.1.sdk to

和iPhoneSimulator5.1.sdk到

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

(您需要重新启动Xcode才能在Base SDK构建选项中选择SDK。)

#2


48  

None of the above worked on my 10.8 xcode 4.5.1. Most of the paths given above are not found.

以上都不适用于我的10.8 xcode 4.5.1。找不到上面给出的大多数路径。

Here is my solution note.

这是我的解决方案说明。

  1. Download xcode_4.4.1_6938145.dmg in https://developer.apple.com/downloads/
  2. 在https://developer.apple.com/downloads/下载xcode_4.4.1_6938145.dmg
  3. 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).
  4. 加载dmg文件然后转到Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs /你会发现iPhoneOS5.1.sdk(在这种情况下这就是我想要的)。
  5. Copy iPhoneOS5.1.sdk folder into your Xcode folder /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  6. 将iPhoneOS5.1.sdk文件夹复制到Xcode文件夹/Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  7. Restart Xcode
  8. 重启Xcode
  9. Open Xcode project setting->build settings->base SDK, then you will see iOS 5.1 option.
  10. 打开Xcode项目设置 - >构建设置 - >基础SDK,然后你会看到iOS 5.1选项。

#3


3  

From the terminal, run this command, then restart XCode:

从终端运行此命令,然后重新启动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.

注意,将“iPhoneOS5.0.sdk”替换为您要复制的任何SDK的名称。

#4


3  

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

最佳解决方案是转到XCode首选项并从那里安装旧版本的iOS模拟器/ SDK,如下所述:https://apple.stackexchange.com/questions/47323/installing-xcode-with-ios-4 -3-设备模拟器

Hope this helps :)

希望这可以帮助 :)

#5


2  

@benvolioT answer is correct, but you need permission:

@benvolioT答案是正确的,但您需要获得许可:

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

#6


1  

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

可以使用finder从这些位置获取用于OS和Simulator的旧SDK。

For OS

对于OS

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

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

For Simulator

对于模拟器

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

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

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

开发人员,您会在设备卷路径中找到它。

#7


1  

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

Akhildas的解决方案对我有用。我能够使用XCode 4.5.1构建5.1 SDK。一个警告:

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.

如果从通过其他Apple ID下载的XCode版本中删除SDK,App Store将显示您有4.5.1的更新(即使您已经拥有它)。当您按更新按钮时,它会告诉您使用其他Apple ID登录。

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

奇怪,我想知道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.

此外,当我将基本SDK设置回iOS 6时,您似乎必须重新启动XCode才能识别该框架。

#1


57  

You need to copy the iPhoneOS5.1.sdk to the directory

您需要将iPhoneOS5.1.sdk复制到该目录

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk

and iPhoneSimulator5.1.sdk to

和iPhoneSimulator5.1.sdk到

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

(您需要重新启动Xcode才能在Base SDK构建选项中选择SDK。)

#2


48  

None of the above worked on my 10.8 xcode 4.5.1. Most of the paths given above are not found.

以上都不适用于我的10.8 xcode 4.5.1。找不到上面给出的大多数路径。

Here is my solution note.

这是我的解决方案说明。

  1. Download xcode_4.4.1_6938145.dmg in https://developer.apple.com/downloads/
  2. 在https://developer.apple.com/downloads/下载xcode_4.4.1_6938145.dmg
  3. 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).
  4. 加载dmg文件然后转到Contents / Developer / Platforms / iPhoneOS.platform / Developer / SDKs /你会发现iPhoneOS5.1.sdk(在这种情况下这就是我想要的)。
  5. Copy iPhoneOS5.1.sdk folder into your Xcode folder /Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  6. 将iPhoneOS5.1.sdk文件夹复制到Xcode文件夹/Applications/Xcode/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
  7. Restart Xcode
  8. 重启Xcode
  9. Open Xcode project setting->build settings->base SDK, then you will see iOS 5.1 option.
  10. 打开Xcode项目设置 - >构建设置 - >基础SDK,然后你会看到iOS 5.1选项。

#3


3  

From the terminal, run this command, then restart XCode:

从终端运行此命令,然后重新启动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.

注意,将“iPhoneOS5.0.sdk”替换为您要复制的任何SDK的名称。

#4


3  

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

最佳解决方案是转到XCode首选项并从那里安装旧版本的iOS模拟器/ SDK,如下所述:https://apple.stackexchange.com/questions/47323/installing-xcode-with-ios-4 -3-设备模拟器

Hope this helps :)

希望这可以帮助 :)

#5


2  

@benvolioT answer is correct, but you need permission:

@benvolioT答案是正确的,但您需要获得许可:

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

#6


1  

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

可以使用finder从这些位置获取用于OS和Simulator的旧SDK。

For OS

对于OS

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

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

For Simulator

对于模拟器

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

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

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

开发人员,您会在设备卷路径中找到它。

#7


1  

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

Akhildas的解决方案对我有用。我能够使用XCode 4.5.1构建5.1 SDK。一个警告:

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.

如果从通过其他Apple ID下载的XCode版本中删除SDK,App Store将显示您有4.5.1的更新(即使您已经拥有它)。当您按更新按钮时,它会告诉您使用其他Apple ID登录。

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

奇怪,我想知道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.

此外,当我将基本SDK设置回iOS 6时,您似乎必须重新启动XCode才能识别该框架。