xcode Xcode5.1 xcrun:错误:无法找到实用程序“PackageApplication”,不是开发人员工具或在 PATH 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22375665/
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:45:43  来源:igfitidea点击:

Xcode5.1 xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

iosxcodexcrun

提问by 100grams

After installing Xcode5.1 with iPhone7.1 sdk I am getting the following error when trying to package my application in the command line:

使用 iPhone7.1 sdk 安装 Xcode5.1 后,尝试在命令行中打包我的应用程序时出现以下错误:

xcodebuild: error: SDK "iPhoneOS7.1.sdk" cannot be located. xcrun: error: unable to find utility "PackageApplication", not a developer tool or in PATH

xcodebuild:错误:无法找到 SDK“iPhoneOS7.1.sdk”。xcrun:错误:无法找到实用程序“PackageApplication”,不是开发人员工具或在 PATH 中

I have already installed Xcode command line tools in previous version of Xcode and the upgrade to Xcode5.1 did not remove them. The option to install "command line tools" is not available in Xcode preferences/downloads.

我已经在之前版本的 Xcode 中安装了 Xcode 命令行工具,升级到 Xcode5.1 并没有删除它们。Xcode 首选项/下载中不提供安装“命令行工具”的选项。

Any ideas how to fix this error?

任何想法如何解决这个错误?

回答by Bart van Kuik

I got this error when using Carthage. It happened because I first installed the commandline tools, and only afterwards, the full Xcode application. To fix this, I had to run the following command:

使用 Carthage 时出现此错误。这是因为我首先安装了命令行工具,然后才安装了完整的 Xcode 应用程序。为了解决这个问题,我必须运行以下命令:

$ sudo xcode-select --reset

回答by 100grams

Right, so after a short trial and error loop I figured it out: I was calling xcrunwith an sdk name it does not recognize:

是的,经过短暂的反复试验后,我想通了:我正在xcrun使用它无法识别的 sdk 名称进行调用:

xcrun -sdk iPhoneOS7.1.sdk PackageApplication -v appName.app -o appName.ipa  

The correct syntax which worked for me is:

对我有用的正确语法是:

xcrun -sdk iphoneos PackageApplication -v appName.app -o appName.ipa  

回答by Irfan

I found how to automate the build and archive process from the command line, I just find a blog articleexplaining how you can achieve that.

我找到了如何从命令行自动化构建和存档过程,我只是找到了一篇博客文章,解释了如何实现这一点。

The command you have to use is xcrun:

您必须使用的命令是 xcrun:

/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}"

You will find all the details in the article. If you have any questions dont hesitate to ask there.

您将在文章中找到所有详细信息。如果您有任何问题,请不要犹豫,在那里提问。

Hope this will help you out.

希望这会帮助你。

回答by user7539530

After Xcode 8.x,Apple remove PackageApplication ,so ,you should download PackageApplication to the specified dir. The dir is :/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

在 Xcode 8.x 之后,Apple 移除了 PackageApplication ,因此,您应该将 PackageApplication 下载到指定的目录。目录是:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

Then you should query and download PackageApplication. github: https://github.com/HymanSteven/PackageApplication

然后你应该查询和下载PackageApplication。github:https: //github.com/HymanSteven/PackageApplication