xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」

(77) 2024-05-26 09:01:01
一、简介
Alcatraz 是一款 Xcode的插件管理工具,可以用来管理XCode的插件、模版以及颜色配置等。而适当地用一些插件,可以提供开发效率。

二、安装
这里得做一个区分,针对Xcode 8+以及低于Xcode 8的版本。
1、低于 Xcode 8版本的安装方法
1)、先卸载之前安装过的以及清除掉之前缓存的
$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin

$ rm -rf ~/Library/Application\ Support/Alcatraz/

2)、开始安装
这里有两个方法
方法一:
1、终端输入命令
curl -fsSL https://raw.github.com/alcatraz/Alcatraz/master/Scripts/install.sh | sh
xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第1张

2、查看插件安装目录 ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第2张


方法二:
1、前往Alcatraz的github地址 https://github.com/alcatraz/Alcatraz,下载
2、直接运行工程

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第3张


3、查看插件安装目录 ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第4张


3)、使用
1、退出Xcode,直接按command + Q
2、重新打开Xcode,会出现提示框,点击Load Bundle

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第5张


3、点击window -> Package Manager, 搜索相应插件,安装后退出Xcode,重启Xcode,出现操作2中的提示框,点击Load Bundle后即可使用。


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第6张


2、Xcode 8+版本的安装方法
这里有个很大的区别,按照以上方法安装后,在window目录下并没有Package Manager选项


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第7张


分析:没有将当前Xcdoe版本的UUID赋值给插件,导致插件无法识别当前Xcode
解决方法:

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第8张


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第9张

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第10张
xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第11张

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第12张

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第13张

也可以用以下指令直接操作
1、获取DVTPlugInCompatibilityUUID
$ defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第14张


2、将DVTPlugInCompatibilityUUID添加到插件里
$ find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add ************(第一步获取的DVTPlugInCompatibilityUUID)


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第15张


然而,并没有啥卵用--__--||


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第16张


分析:估计是Xcode 8+后对插件管理做了一些处理,经过一番搜索,终于找到了一个有用的信息:Xcode 8开始对于Alcatraz中安装的插件已经不支持,但是苹果推出了自己的扩展,也就是Xcode 8 中提供了开发插件的扩展

因此得执行以下操作
1、安装
$ sudo gem install update_xcode_plugins

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第17张


2、查看
$ update_xcode_plugins

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第18张


3、修复, 会对Xcode执行去除签名验证的操作,对于后期打包上传AppStore可能有影响,因此可以自己先手动备份一个Xcode,用备份的Xcode来试验。
$ update_xcode_plugins —unsign
($ update_xcode_plugins —restore )  重置,会将之前去除签名验证的Xcode重新获取签名验证。

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第19张


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第20张

然后重新打开执行过unsign的那个Xcode

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第21张


xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第22张

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第23张

安装到一半,报错

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第24张


出现此问题是因为我是用备份的Xcode来测试,执行unsigned操作,但是在这之前,没将备份的Xcode的UUID添加到插件里面,因此无法识别,解决方法就是按照以上操作,将备份Xcode的UUID添加到插件里面。

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第25张


然后又出现这个问题,估计是在前面已经执行过安装Alcatraz的操作,本地有缓存

xcode插件开发_苹果越狱插件缺少依赖怎么办「建议收藏」 (https://mushiming.com/)  第26张


执行命令,卸载
$ rm -rf ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins/Alcatraz.xcplugin

$ rm -rf ~/Library/Application\ Support/Alcatraz/

重装
$ curl -fsSL
https://raw.github.com/alcatraz/Alcatraz/master/Scripts/install.sh
| sh

$ sudo gem install update_xcode_plugins

$ update_xcode_plugins

$ update_xcode_plugins —unsign


















THE END

发表回复