尝试将 shell 脚本作为构建步骤运行时,Xcode4 出现 Shell 脚本调用错误
以下是我尝试构建 Xcode 项目时得到的结果:
Intermediates/demo2.build/Debug-iphonesimulator/demo2.build/Script-5E564EAC1393823C00BFBA83.sh
/Users/ssbarnea/Library/Developer/Xcode/DerivedData/demo2-fdzrmxojwtekcbeivraccjjadvqz/Build/Intermediates/demo2.build/Debug-iphonesimulator/demo2.build/Script-5E564EAC1393823C00BFBA83.sh: line 2: ${PROJECT_DIR}/local-deploy.sh: No such file or directory
在 Xcode 中,我向默认目标添加了一个新的构建阶段,即一个与 shell /bin/sh
一起运行的“运行脚本”,并且仅包含:
'${PROJECT_DIR}/local-deploy.sh'
我可以向您保证 local-deploy.sh 文件存在于项目目录中并且是可执行的。如果我从控制台调用它,它甚至可以工作;)
Here is what I get when I try to build my Xcode project:
Intermediates/demo2.build/Debug-iphonesimulator/demo2.build/Script-5E564EAC1393823C00BFBA83.sh
/Users/ssbarnea/Library/Developer/Xcode/DerivedData/demo2-fdzrmxojwtekcbeivraccjjadvqz/Build/Intermediates/demo2.build/Debug-iphonesimulator/demo2.build/Script-5E564EAC1393823C00BFBA83.sh: line 2: ${PROJECT_DIR}/local-deploy.sh: No such file or directory
In Xcode I added to the default arget a new Build Phase, a "Run Script" that runs with shell /bin/sh
and contains only:
'${PROJECT_DIR}/local-deploy.sh'
I can assure you that the local-deploy.sh file exists in the project directory and that it is executable. It even works if I call it from the console ;)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
应该是下面这样。 s/'/"/g :-)
It should be the following. s/'/"/g :-)
嗯,我认为替换它不会起作用。您只需将 OpenCV.framework 文件夹放入正确的项目文件夹中,我认为就是这样。我尝试了一下并且成功了。
Well, I don't think that replacing this will work. You need just put OpenCV.framework folder in proper project folder and I think that is it. I tried out and it worked.