最近用XCode写一些C++的测试,遇到一个问题,我升级过XCode所以现在看不到所有的旧插件了,网上找了一圈,需要手动创建证书然后重新对之前的插件进行签名。最后我找到一个插件可以很方便的对之前插件进行恢复。

关闭XCode

别忘记关XCode,不然过程中还会提醒关闭。

使用Gem下载

Gem 是Mac自带的Ruby内建的功能,所以Mac用户也不必纠结什么是Gem.就是一个插件下载器,使用下面的命令安装好工具

1
gem install update_xcode_plugins 

当然你同样可以通过github下载 https://github.com/inket/update_xcode_plugins

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
keyle@xiaonians-MacBook-Pro  ~  sudo gem install update_xcode_plugins
Password:
Fetching: colorize-0.8.1.gem (100%)
Successfully installed colorize-0.8.1
Fetching: tins-1.20.2.gem (100%)
Successfully installed tins-1.20.2
Fetching: term-ansicolor-1.7.1.gem (100%)
Successfully installed term-ansicolor-1.7.1
Fetching: inquirer-0.2.1.gem (100%)
Successfully installed inquirer-0.2.1
Fetching: update_xcode_plugins-0.4.0.gem (100%)
Successfully installed update_xcode_plugins-0.4.0
Parsing documentation for colorize-0.8.1
Installing ri documentation for colorize-0.8.1
Parsing documentation for tins-1.20.2
Installing ri documentation for tins-1.20.2
Parsing documentation for term-ansicolor-1.7.1
Installing ri documentation for term-ansicolor-1.7.1
Parsing documentation for inquirer-0.2.1
Installing ri documentation for inquirer-0.2.1
Parsing documentation for update_xcode_plugins-0.4.0
Installing ri documentation for update_xcode_plugins-0.4.0
Done installing documentation for colorize, tins, term-ansicolor, inquirer, update_xcode_plugins after 1 seconds
5 gems installed

查看本机现有XCode插件

使用 update_xcode_plugins 命令可以直接更新旧签名插件。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
keyle@xiaonians-MacBook-Pro  ~  update_xcode_plugins
Found:
- Xcode (10.1) [D7881182-AD00-4C36-A94D-F45FC9B0CF85]: /Applications/Xcode.app

Plugins:
- AutoIndentWithSave (1.0)
- XToDo (1.0)
- RSImageOptimPlugin (1.0)
- Alcatraz (1.2.1)
- BBUDebuggerTuckAway (1.0)
- Auto-Importer (1.0)
- VVDocumenter-Xcode (1.0)
- OMQuickHelp (1.0.1)
- AutoHighlightSymbol (1.1)
- OMColorSense (1.0.1)

Updating...

Finished! 🎉

It seems that you have Xcode 8+ installed!
Some plugins might not work on recent versions of Xcode because of library validation.
See https://github.com/alcatraz/Alcatraz/issues/475

Run `update_xcode_plugins --unsign` to fix this.

在上面他提升我的某些插件可能会有问题需要使用 update_xcode_plugins --unsign 解决一下。
执行这条命令之后我忘记关XCode,按照提示关闭XCode后继续。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
 keyle@xiaonians-MacBook-Pro  ~  update_xcode_plugins --unsign
Looking for Xcode...

Unsigning Xcode will make it skip library validation allowing it to load plugins.
However, an unsigned Xcode presents security risks, and will be untrusted by both Apple and your system.
This tool will create a backup and allow you to restore Xcode's signature by running
$ update_xcode_plugins --restore

Choose which Xcode you would like to unsign (use arrows): Xcode (10.1) [Signed]: /Applications/Xcode.app
Unsign xcodebuild too?: Yes

Unsigning...

* Changing ownership of /Applications/Xcode.app/Contents/MacOS (will be restored after)
* Restored ownership of /Applications/Xcode.app/Contents/MacOS

* Changing ownership of /Applications/Xcode.app/Contents/Developer/usr/bin (will be restored after)
* Restored ownership of /Applications/Xcode.app/Contents/Developer/usr/bin
Finish

完成

这应该是我安装插件以来最轻松愉快的体验了。

看到Window菜单下的PackageManager了