安装新的Xcode版本后,较旧的SDK消失了

时间:2023-01-17 09:31:34

Why are old SDKs beeing removed when installing a new version of xcode with new Iphone SDK ? Now we have v4, what settings do I have to make in order that the apps still work with 3.x ?

为什么在使用新的Iphone SDK安装新版本的xcode时会删除旧的SDK?现在我们有v4,为了使应用程序仍然可以与3.x一起使用,我必须进行哪些设置?

Thanks

谢谢

5 个解决方案

#1


7  

Set the Base SDK to 4.0 and Deployment Target to 3.x. Or, in modern conditions, the Base SDK to Latest and Deployment Target to whatever you need.

将Base SDK设置为4.0,将Deployment Target设置为3.x.或者,在现代条件下,Base SDK to Latest和Deployment Target可满足您的需求。

#2


7  

Although 'Zoul' has most succinctly answered the question, I shall make an attempt to elaborate on the 2 settings and point to some useful documents which will help others who are new to the situation.

尽管'Zoul'已经最简洁地回答了这个问题,但我将尝试详细说明这两个设置,并指出一些有用的文档,这些文档将帮助其他不熟悉情况的人。

  1. Base SDK Version: This indicates the version of the SDK based on which the program has been compiled. This can be set from the "Build Settings" for the project or target. You can use API code from Apple in your code introduced up-to that version and compiler will know all the symbols and compile without any issues.

    基本SDK版本:这表示基于编译程序的SDK版本。这可以通过项目或目标的“构建设置”进行设置。你可以在你的代码中使用来自Apple的API代码 - 该版本和编译器将知道所有符号并编译而没有任何问题。

  2. Deployment target: This is a declaration from your side about the minimum iOS version which should be installed on the user's device to run your code. This setting can be found under "Info" section for Project and "Summary" section for a particular target. Now, important thing to understand is that your code will not automatically run smoothly on devices with older versions of the iOS if you are using API code introduced in later version by Apple. These can be new classes/methods/frameworks introduced by Apple in later version. You have to ensure by writing necessary conditional code and provide alternate code path to gracefully degrade for older iOS version which does not have the newer API. It is up-to you to handle version incompatibilities.

    部署目标:这是您方面关于应该在用户设备上安装以运行代码的最低iOS版本的声明。此设置可在项目的“信息”部分和特定目标的“摘要”部分中找到。现在,重要的是要理解的是,如果您使用的是Apple的更高版本中引入的API代码,那么在具有旧版iOS的设备上,您的代码将无法自动运行。这些可以是Apple在更高版本中引入的新类/方法/框架。您必须通过编写必要的条件代码来确保并提供备用代码路径,以便为没有较新API的旧iOS版本优雅地降级。您可以自行处理版本不兼容问题。

Apple documentation on the subject can be found in "SDK Compatibility Guide".

有关此主题的Apple文档可在“SDK兼容性指南”中找到。

To know about the changes with different versions of iOS refer "What's new in iOS".

要了解不同iOS版本的更改,请参阅“iOS中的新功能”。

This topic is also discussed in "iOS Development Guide" under section "Building and Running Application". Refer sub-section "Specifying the Runtime Environment".

“iOS开发指南”的“构建和运行应用程序”一节中也讨论了该主题。请参阅“指定运行时环境”小节。

#3


3  

If you have backups of your system from something like Time Machine (and you better!) you can copy the older SDKs from the backup located at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs - then just restart XCode and you're ready to go.

如果您从Time Machine(以及更好!)等系统备份系统,则可以从位于/Developer/Platforms/iPhoneOS.platform/Developer/SDKs和/Developer/Platforms/iPhoneSimulator.platform的备份中复制旧版SDK。 / Developer / SDKs - 然后只需重新启动XCode就可以了。

#4


3  

If you still have the problem after you set Deployment target at least as low as your desired SDK, then you need to download that SDK. Luckily, Xcode helps us here also:

如果在将部署目标设置为至少与所需SDK一样低之后仍然存在问题,则需要下载该SDK。幸运的是,Xcode还帮助我们:

  • look after Simulator selector in top left of your Xcode and select More Simulators. It will open a page like the one below:
  • 在Xcode的左上角看模拟器选择器,然后选择更多模拟器。它将打开如下所示的页面:

安装新的Xcode版本后,较旧的SDK消失了

  • just select the SDK you need to test your app against.
  • 只需选择您需要测试应用程序的SDK。

#5


1  

3.2.3 last beta did remove all other SDK's cause to many people tried publish Apps developed with the beta SDK, which will not be accepted. I guess GM is doing still the same

3.2.3上一次测试确实删除了所有其他SDK的原因,许多人尝试使用beta SDK开发的发布应用程序,这将不被接受。我猜通用汽车仍在做同样的事情

If you want to develop for 4.0,3.2 and 3.0 (plus 3.0,3.1,3.1.2,3.1.3) do the following

如果要开发4.0,3.2和3.0(加上3.0,3.1,3.1.2,3.1.3),请执行以下操作

  • sudo /Developer/Library/uninstall-devtools –mode=all (This will uninstall the current XCode installation)
  • sudo / Developer / Library / uninstall-devtools -mode = all(这将卸载当前的XCode安装)
  • Then install first old XCode (3.2 final) in default folder (/Developer)
  • 然后在默认文件夹(/ Developer)中安装第一个旧的XCode(3.2 final)
  • Then install the new XCode (3.2.3 GM) in other folder (/DeveloperBeta)
  • 然后在其他文件夹(/ DeveloperBeta)中安装新的XCode(3.2.3 GM)
  • This way you will have both. And can launch xcode from either /Developer/Applications/Xcode.app or /DeveloperBeta/Applications/Xcode.app
  • 这样你就可以拥有两者。并且可以从/Developer/Applications/Xcode.app或/DeveloperBeta/Applications/Xcode.app启动xcode

#1


7  

Set the Base SDK to 4.0 and Deployment Target to 3.x. Or, in modern conditions, the Base SDK to Latest and Deployment Target to whatever you need.

将Base SDK设置为4.0,将Deployment Target设置为3.x.或者,在现代条件下,Base SDK to Latest和Deployment Target可满足您的需求。

#2


7  

Although 'Zoul' has most succinctly answered the question, I shall make an attempt to elaborate on the 2 settings and point to some useful documents which will help others who are new to the situation.

尽管'Zoul'已经最简洁地回答了这个问题,但我将尝试详细说明这两个设置,并指出一些有用的文档,这些文档将帮助其他不熟悉情况的人。

  1. Base SDK Version: This indicates the version of the SDK based on which the program has been compiled. This can be set from the "Build Settings" for the project or target. You can use API code from Apple in your code introduced up-to that version and compiler will know all the symbols and compile without any issues.

    基本SDK版本:这表示基于编译程序的SDK版本。这可以通过项目或目标的“构建设置”进行设置。你可以在你的代码中使用来自Apple的API代码 - 该版本和编译器将知道所有符号并编译而没有任何问题。

  2. Deployment target: This is a declaration from your side about the minimum iOS version which should be installed on the user's device to run your code. This setting can be found under "Info" section for Project and "Summary" section for a particular target. Now, important thing to understand is that your code will not automatically run smoothly on devices with older versions of the iOS if you are using API code introduced in later version by Apple. These can be new classes/methods/frameworks introduced by Apple in later version. You have to ensure by writing necessary conditional code and provide alternate code path to gracefully degrade for older iOS version which does not have the newer API. It is up-to you to handle version incompatibilities.

    部署目标:这是您方面关于应该在用户设备上安装以运行代码的最低iOS版本的声明。此设置可在项目的“信息”部分和特定目标的“摘要”部分中找到。现在,重要的是要理解的是,如果您使用的是Apple的更高版本中引入的API代码,那么在具有旧版iOS的设备上,您的代码将无法自动运行。这些可以是Apple在更高版本中引入的新类/方法/框架。您必须通过编写必要的条件代码来确保并提供备用代码路径,以便为没有较新API的旧iOS版本优雅地降级。您可以自行处理版本不兼容问题。

Apple documentation on the subject can be found in "SDK Compatibility Guide".

有关此主题的Apple文档可在“SDK兼容性指南”中找到。

To know about the changes with different versions of iOS refer "What's new in iOS".

要了解不同iOS版本的更改,请参阅“iOS中的新功能”。

This topic is also discussed in "iOS Development Guide" under section "Building and Running Application". Refer sub-section "Specifying the Runtime Environment".

“iOS开发指南”的“构建和运行应用程序”一节中也讨论了该主题。请参阅“指定运行时环境”小节。

#3


3  

If you have backups of your system from something like Time Machine (and you better!) you can copy the older SDKs from the backup located at /Developer/Platforms/iPhoneOS.platform/Developer/SDKs and /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs - then just restart XCode and you're ready to go.

如果您从Time Machine(以及更好!)等系统备份系统,则可以从位于/Developer/Platforms/iPhoneOS.platform/Developer/SDKs和/Developer/Platforms/iPhoneSimulator.platform的备份中复制旧版SDK。 / Developer / SDKs - 然后只需重新启动XCode就可以了。

#4


3  

If you still have the problem after you set Deployment target at least as low as your desired SDK, then you need to download that SDK. Luckily, Xcode helps us here also:

如果在将部署目标设置为至少与所需SDK一样低之后仍然存在问题,则需要下载该SDK。幸运的是,Xcode还帮助我们:

  • look after Simulator selector in top left of your Xcode and select More Simulators. It will open a page like the one below:
  • 在Xcode的左上角看模拟器选择器,然后选择更多模拟器。它将打开如下所示的页面:

安装新的Xcode版本后,较旧的SDK消失了

  • just select the SDK you need to test your app against.
  • 只需选择您需要测试应用程序的SDK。

#5


1  

3.2.3 last beta did remove all other SDK's cause to many people tried publish Apps developed with the beta SDK, which will not be accepted. I guess GM is doing still the same

3.2.3上一次测试确实删除了所有其他SDK的原因,许多人尝试使用beta SDK开发的发布应用程序,这将不被接受。我猜通用汽车仍在做同样的事情

If you want to develop for 4.0,3.2 and 3.0 (plus 3.0,3.1,3.1.2,3.1.3) do the following

如果要开发4.0,3.2和3.0(加上3.0,3.1,3.1.2,3.1.3),请执行以下操作

  • sudo /Developer/Library/uninstall-devtools –mode=all (This will uninstall the current XCode installation)
  • sudo / Developer / Library / uninstall-devtools -mode = all(这将卸载当前的XCode安装)
  • Then install first old XCode (3.2 final) in default folder (/Developer)
  • 然后在默认文件夹(/ Developer)中安装第一个旧的XCode(3.2 final)
  • Then install the new XCode (3.2.3 GM) in other folder (/DeveloperBeta)
  • 然后在其他文件夹(/ DeveloperBeta)中安装新的XCode(3.2.3 GM)
  • This way you will have both. And can launch xcode from either /Developer/Applications/Xcode.app or /DeveloperBeta/Applications/Xcode.app
  • 这样你就可以拥有两者。并且可以从/Developer/Applications/Xcode.app或/DeveloperBeta/Applications/Xcode.app启动xcode