由brew安装的Protoc似乎不适用于自定义构建规则
我有一台 M1,带有 XCode 13.2.1 和 monterey。
我已经按照官方步骤安装了brew,并且还执行了额外的两个步骤,因此新的brew路径被添加到我的路径中。
另外,我已将 export PATH=/opt/homebrew/bin:$PATH
添加到我的 .zshrc
我已经安装了 protobuf
和 swift-protobuf
与brew,我可以在终端中运行它们而不会出现错误。
但是,当我在 XCode 构建规则的自定义脚本中使用 protoc
时,出现以下错误:
/bin/sh: protoc: command not found
/bin/sh: line 7: protoc: command not found
/bin/sh: line 9: protoc: command not found
我可以添加从 which protoc 获得的
但我不确定这是否会给其他架构带来问题。protoc
路径
知道为什么如果 protoc
在我的终端中运行,它没有在 XCode 构建规则中的自定义脚本中运行吗?
I've got a M1, with XCode 13.2.1 and monterey.
I've installed brew following the official steps and also I did the extra two steps so the new brew path is added to my path.
Additionally I've added export PATH=/opt/homebrew/bin:$PATH
to my .zshrc
I've installed protobuf
and swift-protobuf
with brew and I can run both in the terminal with no errors.
But when I use protoc
in a custom script in XCode build rules, I get the following error:
/bin/sh: protoc: command not found
/bin/sh: line 7: protoc: command not found
/bin/sh: line 9: protoc: command not found
I could add the path of protoc
which I got from which protoc
but I'm not sure if that would make a problem for other architectures.
Any idea why if protoc
is running in my terminal, it's not running in custom script in XCode Build Rules?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
请
如果没有 bin 文件夹, 创建它。也许它在终端上不起作用,您可以从 Finder 中执行此操作
之后,从终端转到文件夹并写入
并
退出 Xcode,清理构建文件夹并重试
Go to
if there isn't the bin folder create it. Maybe it doesn't work from terminal, you can do it from Finder
After that go to the folder from the terminal and write
and
Quit Xcode, clean build folder and retry