$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew安装ldid$ brew install ldid$ vim ~/.bash_profile.bash_profile文件后面加入以下2行export THEOS=~/theos
export PATH=$THEOS/bin:$PATH.bash_profile配置的环境变量立即生效(或者重新打开终端)$ source ~/.bash_profile$THEOS目录下载代码(也就是刚才配置的~/theos)$ git clone --recursive https://github.com/theos/theos.git $THEOS$ cd ~/Desktop
$ nic.pl[11.] iphone/tweak
Cycript查看APP的Bundle identifierexport THEOS_DEVICE_IP=127.0.0.1
export THEOS_DEVICE_PORT=10010
include $(THEOS)/makefiles/common.mk
TWEAK_NAME = tingtweak2
tingtweak2_FILES = Tweak.xm
include $(THEOS_MAKE_PATH)/tweak.mk
after-install::
install.exec "killall -9 SpringBoard"如果不希望每个项目的Makefile都编写IP和端口环境变量,也可以添加到用户的配置文件中,编辑完毕后$ source ~/.bash_profile(或者重启终端)
$ vim ~/.bash_profile
export THEOS=~/theos
export PATH=$THEOS/bin:$PATH
export THEOS_DEVICE_IP=127.0.0.1
export THEOS_DEVICE_PORT=10010
$ source ~/.bash_profileTweak.xm文件%hook XMSoundPatchImageView
- (id)initWithFrame:(struct CGRect)arg1{
return nil;
}
%end
%hook XMAdAnimationViewTwo
- (id)initWithFrame:(struct CGRect)arg1{
return nil;
}
%endmakedebmake packagemake installmake package的错误 $ make package
Can't locate IO/Compress/Lzma.pm in @INC (you may need to install the
IO::Compress::Lzma module) (@INC contains: /Library/Perl/5.18/darwin-
thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-
thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2
/System/Library/Perl/5.18/darwin-thread-multi-2level
/System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-
multi-2level /System/Library/Perl/Extras/5.18 .) at
/Users/mj/theos/bin/dm.pl line 12.
BEGIN failed--compilation aborted at /Users/mj/theos/bin/dm.pl line 12.
make: *** [internal-package] Error 2gzip压缩就行了 dm.pl文件,用#号注释掉下面两句$ vim $THEOS/vendor/dm.pl/dm.pl
#use IO::Compress::Lzma;
#use IO::Compress::Xz;deb.mk文件第6行的压缩方式为gzip$ vim $THEOS/makefiles/package/deb.mk
_THEOS_PLATFORM_DPKG_DEB_COMPRESSION ?= gzip$ make
Error: You do not have an SDK in
/Library/Developer/CommandLineTools/Platforms/iPhoneOS.platform/Developer/S
DKs$ sudo xcode-select --switch
/Applications/Xcode.app/Contents/Developer/$ make
> Making all for tweak xxx...
make[2]: Nothing to be done for `internal-library-compile'. 这是因为缓存导致的,但是不影响操作,如需出现原来的打印,可以clean一下
$ make clean
$ make