0. 简书
之前用了很多种方法安装,都不成功,左后直接找到theos官网,安装他的方法,成功了。好激动!!!
1. 安装【thoes】
- 1>安装【dpkg-deb】(打包用的)
brew install dpkg
- 2>安装【ldid】(给可执行文件,签名用的)
brew install ldid
- 3>打开【终端】,设置"替身"(说法不够准确)
export THEOS=/opt/theos
git clone --recursive https://github.com/theos/theos.git $THEOS
- 4>配置 "~/.bash_profile"
export THEOS=/opt/theos
export PATH=$THEOS/bin:$PATH
export THEOS_DEVICE_IP=example.local THEOS_DEVICE_PORT=22
配置完记得在命令行执行"source .bash_profile"命令
- 5>配置substrate
找到一部越狱的手机,将"/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate"文件拷贝出来,重命名为"libsubstrate.dylib"后拷贝到"/opt/theos/lib",将"/Library/Frameworks/CydiaSubstrate.framework/Headers/CydiaSubstrate.h"文件拷贝出来,重命名为"substrate.h"后拷贝到"/opt/theos/include"。 - 6>修改一些文件
如果"make package"时报以下错,
Can't locate IO/Compress/Lzma.pm in @INC (you may need to install the IO::Compress::Lzma module) ...
请修改"/opt/theos/vendor/dm.pl/dm.pl"文件,注释或删掉第12、13行
#use IO::Compress::Lzma;
#use IO::Compress::Xz;
修改"/opt/theos/makefiles/package/deb.mk"文件的第6行lzma改为gzip
_THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= gzip
2. 错误解决
- 1> make时出现如下错误
localhost:changebg zhangwenjun$ make
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
==> Error: You do not have any SDKs in /Library/Developer/CommandLineTools/Platforms/iPhoneOS.platform/Developer/SDKs or /opt/theos/sdks.
解决方法:命令行中输入如下命令
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/
网友评论