官网安装命令:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
如果已经安装想重新安装,则在安装之前先调用此命令:
rm -rf /usr/local/Cellar /usr/local/.git && brew cleanup
当通过HomeBrew去安装套件时(例如:sudo brew install xctool),会遇见此问题:
Error: Cowardly refusing to `sudo brew install`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
这说明现在brew没有root权限。
先查看此文件现在的权限:可以看到,侧文件确实没有root权限。
现在就要修改此文件,使其拥有root权限:
修改后再次查看,这时此文件便拥有了root权限。
现在,你就可以通过sudo brew install xctool去安装自动打包工具xctool了!!!
高级iOS开发技术交流群:415239068,欢迎大家加入