给XCode安装Alcatraz(包管理工具)!!

Alcatraz官方描述: 

Alcatraz is an open-source package manager for Xcode. It lets you discover and install plugins, templates and color schemes without the need for manually cloning or copying files. It installs itself as a part of Xcode and it feels like home.

官网:http://alcatraz.io/

安装方法:

sudo curl -fsSL https://raw.githubusercontent.com/supermarin/Alcatraz/deploy/Scripts/install.sh | sh

解决可能遇到的问题:

问题1:

执行上面命令,最后出现下面错误信息:

xcrun: error: unable to find utility "xcodebuild", not a developer tool or in PATH

解决方法:

Xcode > Preferences > Locations,随后选择XCode命令行工具,应该需要输入root密码,输入之后就能够选中了,随后退出XCode就可以了!

问题2:

如果使用上面命令安装,最后发现安装结果还是失败,

解决方法:

那么解决了可以访问谷歌问题之后,再用上面命令试一试,我相信会成功了!!!

问题3:

Alcatraz安装成功后,无法在XCode的"window"菜单中找到。

解决方法:

安装update_xcode_plugins。

安装和配置update_xcode_plugins:

(1),在shell里面执行命令:

sudo gem install -n /usr/local/bin update_xcode_plugins

(2),验证安装结果,在shell里面执行命令:

sudo update_xcode_plugins

(3),让XCode可以使用插件,在shell里面执行命令。

sudo update_xcode_plugins --unsign

(4),如果想恢复先前的XCode,在shell里面执行下面命令:

sudo update_xcode_plugins --restore

如果一切顺利,现在打开XCode,就能看到在"window"菜单中出现了"Package Manager"了,我们就可以用Alcatraz来管理XCode的插件了!!

注意问题:如果按照上面操作,依然在XCode的"window"菜单中没有"Package Manager",那么多试几次上面操作,我就是重复了几次之后搞定的!

参考:

1,http://stackoverflow.com/questions/40743713/command-line-tool-error-xcrun-error-unable-to-find-utility-xcodebuild-n

2,http://blog.img421.com/2016/09/23/Xcode8%20%E5%AE%89%E8%A3%85Alcatraz%E4%BD%BF%E7%94%A8%E6%8F%92%E4%BB%B6/

3,https://github.com/inket/update_xcode_plugins

原文地址:https://www.cnblogs.com/sunylat/p/6539285.html