【问题标题】:when I built my app in xcode,there is an error:/bin/sh: bad interpreter: Operation not permitted当我在 xcode 中构建我的应用程序时,出现错误:/bin/sh: bad interpreter: Operation not allowed
【发布时间】:2016-11-24 15:51:59
【问题描述】:

错误信息:

/Users/baymac/Library/Developer/Xcode/DerivedData/Accelerometer_Nodes-ccicmwcpsbuvnnfllupzhsbpxwrr/Build/Intermediates/Accelerometer Nodes.build/Debug-iphoneos/Accelerometer Nodes.build/Script-2C82A787FAD9698819CAEFB4.sh: /用户/baymac/文档/patrick lab/ios 项目/DeviceToPhone/Pods/目标支持 Files/Pods/Pods-frameworks.sh: /bin/sh: bad interpreter: 操作不 允许的命令 /bin/sh 失败,退出代码为 126

我尝试过 pods install 或 chmod,它们没用,如果有人能帮助我,那就太好了!

【问题讨论】:

  • pod 未正确安装。或确保您打开的是工作区文件而不是 xcodeproject 文件。
  • 我确实打开了xcodeproject文件,我的同学告诉我不要安装pod,因为我们需要pod中的旧文件。如果我再次安装它,pod会更新,需要的文件可能会被修改。 ...你能帮我吗???
  • 如果您可以将Podfile 的副本添加到您的问题中,那可能会有所帮助。也就是说:每当我遇到 CocoaPods 问题时,我要做的第一件事就是运行 pod deintegrate,然后运行 ​​pod install。这可能值得一试。您需要先安装它才能使用它:github.com/CocoaPods/cocoapods-deintegrate
  • 我试过了,旧 pod 中需要的那些文件丢失了,所以......现在看起来更糟......也许我现在需要重新加载应用程序......
  • 我有同样的问题,但我在项目工作区有几个目标,我无法删除工作区,你找到解决这种情况的方法了吗?

标签: ios iphone xcode bash shell


【解决方案1】:

尝试删除 .xcworkspace 和 Podfile.lock 文件同时删除文件夹 Pod

然后打开终端 键入 cd put 项目根文件夹的路径按 Enter 输入 pod install 或 pod update 按回车

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。

    原因:如果您从互联网下载项目,可执行的.sh文件将被隔离,系统不允许它们执行。

    解决方法:您应该删除扩展属性以使这些可执行文件工作。

    在终端中

    xattr -rc directory_where_executables_located
    

    这将递归地从 directory_where_executables_located 中的文件中删除扩展属性

    【讨论】:

      【解决方案3】:

      如果 install pods 没用,也许你可以找到错误文件的路径,例如,我的路径是 /Users/baymac/Documents/patrick lab/ios project/DeviceToPhone/Pods/Target Support Files/Pods/ Pods-frameworks.sh

      那么你可以使用这个指令: xattr -d com.apple.quarantine+你的路径,例如:

      xattr -d com.apple.quarantine /Users/baymac/Documents/patrick lab/ios project/DeviceToPhone/Pods/Target Support Files/Pods/Pods-frameworks.sh

      确保你的路径是正确的。

      我的问题解决了!

      【讨论】:

      • 没有这样的 xattr: com.apple.quarantine :((
      猜你喜欢
      • 1970-01-01
      • 2021-07-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-21
      • 2018-02-23
      • 2020-07-28
      • 1970-01-01
      相关资源
      最近更新 更多