如何确定使用哪个 xcode 进行代码开发

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21226653/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:34:31  来源:igfitidea点击:

How to determine which xcode was used to develop from code

iosxcode

提问by amar

I have iOS app source code i want to determine which version of xcode was used to develop the project.

我有 iOS 应用程序源代码,我想确定用于开发项目的 xcode 版本。

In project.pbxprojwhen i go to section /* Begin PBXProject section */it says

project.pbxproj当我去节/* Begin PBXProject section */,它说

compatibilityVersion = "Xcode 3.2";

so my guess is it has been developed on some 4.x version not on xcode 5. Please suggest.

所以我的猜测是它是在某些 4.x 版本上开发的,而不是在 xcode 5 上开发的。请建议。

采纳答案by FFFF0H

If you have .xcarchive or .ipa file that is associated with the project then you can determine the version of Xcode that was used to build it. Xcode adds, among other things, a "DTXcode" key to the info.plist upon build.

如果您有与项目关联的 .xcarchive 或 .ipa 文件,那么您可以确定用于构建它的 Xcode 版本。Xcode 会在构建时向 info.plist 添加一个“DTXcode”键。

So open your .xcarchive file with Finder or rename the .ipa file to .zip and open that with Finder.
Navigate to find the app bundle file - that's the one with the .app extension. Right click and "Show Package Contents." Find the info.plist and open that with a text editor.

因此,使用 Finder 打开您的 .xcarchive 文件或将 .ipa 文件重命名为 .zip 并使用 Finder 打开它。
导航以找到应用程序包文件 - 这是带有 .app 扩展名的文件。右键单击并“显示包内容”。找到 info.plist 并使用文本编辑器打开它。

You will see something like:

你会看到类似的东西:

<key>DTXcode</key>
<string>0611</string>

In this case, 611 is Xcode 6.1.1.

在这种情况下,611 是 Xcode 6.1.1。

Alternatively, if you have access to iTunesConnect, you can see the details of a binary that was uploaded. Look for "Build Details" and find a key called "Build SDK." It will be an alphanumeric string, e.g. 12B411.

或者,如果您有权访问 iTunesConnect,则可以查看已上传二进制文件的详细信息。查找“Build Details”并找到一个名为“Build SDK”的键。它将是一个字母数字字符串,例如 12B411。

Since Apple usually only bundles one version of the SDK with Xcode, you can use this site to find the version of Xcode that corresponds to the SDK: https://en.wikipedia.org/wiki/Xcode

由于苹果通常只将一个版本的 SDK 与 Xcode 捆绑在一起,您可以使用此站点查找与 SDK 对应的 Xcode 版本:https: //en.wikipedia.org/wiki/Xcode

In the case of 12B411, I see that is was iOS 8.1 final, which was bundled with Xcode 6.1 build 6A1052d.

在 12B411 的情况下,我看到这是 iOS 8.1 final,它与 Xcode 6.1 build 6A1052d 捆绑在一起。

回答by Bret Johnson - MSFT

If you open the project.pbxproj file and search for CreatedOnToolsVersion, it looks like that will give you what you want here, at least with newer versions of Xcode.

如果您打开 project.pbxproj 文件并搜索CreatedOnToolsVersion,看起来这会给您带来您想要的东西,至少对于较新版本的 Xcode。

I see it set to 7.3.1 in one of my projects and 8.3.2 in another, created with that version of Xcode.

我看到它在我的一个项目中设置为 7.3.1,在另一个项目中设置为 8.3.2,使用该版本的 Xcode 创建。