安装Theos和Monkeydev
认真玩越狱一年了,想学习开发插件,总结一下工具的安装
Theos
我更推荐用MonkeyDev写的安装方法
1 | sudo git clone --recursive https://github.com/theos/theos.git /opt/theos |
在用户目录下的.zprofile
文件内添加如下内容
1 | export THEOS=/opt/theos |
在 Terminal 中运行
1 | nic.pl |
有如下提示即为成功
1 | ~ nic.pl ✔ |
MonkeyDev
下载
1 | sudo git clone https://github.com/AloneMonkey/MonkeyDev.git /opt/MonkeyDev |
安装
1 | cd MonkeyDev/bin |
报错: File /xxx/IDEiOSSupportCore.ideplugin/xxx/Embedded-Device.xcspec not found
macOS 14.5报错如下
1 | ➜ bin sudo ./md-install |
- 原因:
Xcode 13+
之后,部分路径变化了,所以找不到对应路径 - 解决办法:从Xcode中搜索到Embedded-Device.xcspec的实际位置,然后拷贝到报错的路径(如果不存在,先创建对应目录)即可
- 具体步骤
(1)找到Embedded-Device.xcspec
1 | ➜ ~ cd /Applications/Xcode.app/Contents |
找到:
/Applications/Xcode.app/Contents/Developer/Library/Xcode/Plug-ins/XCBSpecifications.ideplugin/Contents/Resources/Embedded-Device.xcspec
(2)拷贝到报错目录
先新建该目录
1 | sudo mkdir -p /Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/Resources/ |
再去拷贝:
1 | sudo cp /Applications/Xcode.app/Contents/Developer/Library/Xcode/Plug-ins/XCBSpecifications.ideplugin/Contents/Resources/Embedded-Device.xcspec /Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/Resources/ |
确认文件的确存在:
1 | ➜ PlugIns ll /Applications/Xcode.app/Contents/PlugIns/IDEiOSSupportCore.ideplugin/Contents/Resources/ |
最后重新去操作:
1 | sudo ./md-install |
报错:File /xxx/Specifications/MacOSX Package Types.xcspec not found
报错如下
1 | bin sudo bash md-install |
解决办法:
Xcode <13
- 背景:存在
MacOSX Package Types.xcspec
,只是路径不对 - 解决办法:改动路径或换用软链接
- 背景:存在
Xcode 13+
背景:不存在
1
MacOSX Package Types.xcspec
(和
1
MacOSX Product Types.xcspec
),所以要去网上下载后,再去:改动路径或换用软链接
下载
1
MacOSX Package Types.xcspec
和
1
MacOSX Product Types.xcspec
qbs/share/qbs/modules/bundle at master · qbs/qbs
中,下载
- https://github.com/qbs/qbs/blob/master/share/qbs/modules/bundle/MacOSX-Package-Types.xcspec
- 保存为:
MacOSX Package Types.xcspec
- 保存为:
- https://github.com/qbs/qbs/blob/master/share/qbs/modules/bundle/MacOSX-Product-Types.xcspec
- 保存为:
MacOSX Product Types.xcspec
- 保存为:
- https://github.com/qbs/qbs/blob/master/share/qbs/modules/bundle/MacOSX-Package-Types.xcspec
拷贝到(旧版Xcode中对应的)目录:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources
然后继续去操作:
【推荐】方法1:使用软链接
1
sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/PrivatePlugIns/IDEOSXSupportCore.ideplugin/Contents/Resources /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Xcode/Specifications
方法2:(修改
md-install
脚本)改动路径修改
/opt/MonkeyDev/bin/md-install
修改路径,改为:
1
2
3
4
5
6# macosxSDKSpecificationsPath=$macosSdkPlatformPath/Developer/Library/Xcode/Specifications
# packageTypesForMacOSXPath="$macosxSDKSpecificationsPath/MacOSX Package Types.xcspec"
# productTypesForMacOSXPath="$macosxSDKSpecificationsPath/MacOSX Product Types.xcspec"
macosxSDKSpecificationsPath=$macosSdkPlatformPath/Developer/Library/Xcode/PrivatePlugIns
packageTypesForMacOSXPath="$macosxSDKSpecificationsPath/IDEOSXSupportCore.ideplugin/Contents/Resources/MacOSX Package Types.xcspec"
productTypesForMacOSXPath="$macosxSDKSpecificationsPath/IDEOSXSupportCore.ideplugin/Contents/Resources/MacOSX Product Types.xcspec"最后重新运行:
1
sudo ./md-install
即可
以上两种错误都是来自我遇到的报错,并且解决方法来自于这里,原文里面还有其他的解决方法,我就不贴了
有佬 fork 了 MonkeyDev 并且适配了 Rootless,在现在这个环境,推荐使用这个,按照readme的安装就好
https://github.com/BigCatGit/MonkeyDev
其他问题
解决 Xcode 报 library not found for -lstdc++ 问题
https://github.com/devdawei/libstdc-
视频教程
视频最后的编译可以试一试,安装还是参考上文