xcode iOS 构建失败;/bin/sh 没有那个文件或目录

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

iOS build failure; /bin/sh No such file or directory

iosxcodebuildcompiler-errorssh

提问by Jon Erickson

I was working on my application and then out of no where, I get this build error and can't figure out why it won't go away. Obviously it thinks I am missing a script of some sort. Anybody else know why? I am using Xcode 4.5.1.

我正在处理我的应用程序,然后莫名其妙地出现了这个构建错误,并且无法弄清楚为什么它不会消失。显然它认为我缺少某种脚本。还有人知道为什么吗?我正在使用 Xcode 4.5.1。

/bin/sh: /Users/JonErickson/Library/Developer/Xcode/DerivedData/FireCom-cygbnsedlgybvdewalvvmzqeehlc/Build/Intermediates/FireCom.build/Debug-iphonesimulator/FireCom.build/Script-C8CC6BE415FAAB4C001BB67E.sh: (null): bad interpreter: No such file or directory

/bin/sh: /Users/JonErickson/Library/Developer/Xcode/DerivedData/FireCom-cygbnsedlgybvdewalvvmzqeehlc/Build/Intermediates/FireCom.build/Debug-iphonesimulator/FireCom.build/Script-C8CC6BE415FAAB4C001BB67E.sh interpreter: bader : 无此文件或目录

回答by Michael Dautermann

Check for a potentially corrupt "run script" phase in your project's "build phases".

检查项目的“构建阶段”中是否存在潜在损坏的“运行脚本”阶段。

It should look something like this:

它应该是这样的:

Build Phase

构建阶段

回答by Khulja Sim Sim

I had renamed my app, and got into this error. In various places, I changed the name but couldn't find at one spot .. - in Target's build setting file.

我重命名了我的应用程序,并陷入了这个错误。在不同的地方,我更改了名称,但在一个地方找不到 .. - 在 Target 的构建设置文件中。

Cmd + Shift + F to find in whole project. searched for old App name string. Found places where old name was still stuck, updated it with new name.

Cmd + Shift + F 在整个项目中查找。搜索旧的应用程序名称字符串。找到旧名称仍然卡住的地方,用新名称更新它。

enter image description here

enter image description here

回答by Badam Baplan

I've encountered this a number of times because my DerivedDataisn't current with my work. I've never understand the logic for when it does and does not keep track of changes I'm making... but since the script is trying to run from an archive in the derived data, you'll need to make sure the script is actually present. To do this, delete your derived data (or at least the directory containing your script) and then build again. Xcode will fill in the gap(s). You can get quick access to Derived Databy navigating to the Filemenu and then going to Project Settings(or Workspace Settingsaccordingly) and following the link to your finder. Just trash it.

我已经多次遇到这种情况,因为DerivedData我的工作不是最新的。我从来不明白它何时执行并且不跟踪我所做的更改的逻辑......但是由于脚本试图从派生数据中的存档中运行,您需要确保脚本实际上存在。为此,请删除派生数据(或至少包含脚本的目录),然后重新构建。Xcode 将填补空白。您可以Derived Data通过导航到File菜单,然后转到Project Settings(或Workspace Settings相应地)并按照链接找到您的查找器来快速访问。垃圾就行了