Xcode 未找到 Mogenerator

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

Mogenerator not found by Xcode

iosxcodexcdatamodelmogenerator

提问by Grzegorz

I'm trying to use Mogenerator in my iOS project developed in Xcode 5. I've installed Mogenerator with brew:

我正在尝试在我用 Xcode 5 开发的 iOS 项目中使用 Mogenerator。我已经用 brew 安装了 Mogenerator:

brew install mogenerator

then link:

然后链接:

brew link mogenerator

After that I have access to this tool from my command line.

之后,我可以从命令行访问此工具。

Next I'm trying to add one more step (script executing) in build phases (shell /bin/sh):

接下来,我尝试在构建阶段 (shell /bin/sh) 中再添加一个步骤(脚本执行):

mogenerator --model "${PROJECT_DIR}/MyProject/Model.xcdatamodeld/Model.xcdatamodel" --output-dir "${PROJECT_DIR}/MyProject" --template-var arc=true

In effect I get error:

实际上我得到错误:

line 2: mogenerator: command not found
Command /bin/sh failed with exit code 127

Do you have any advices how can resolve this issue?

你有什么建议如何解决这个问题?

回答by Martin R

If /usr/local/bin is not in the search path used by Xcode, you can call mogenerator with an absolute (full) path:

如果 /usr/local/bin 不在 Xcode 使用的搜索路径中,您可以使用绝对(完整)路径调用 mogenerator:

/usr/local/bin/mogenerator --model ...