Add the following to ~/.bash_profile
(create the file if it does not exist by typing touch ~/.bash_profile
into terminal. The touch
command simply creates a file if it does not exist):
export THEOS=/opt/theos
export PATH=$THEOS/bin:$PATH
export THEOS_DEVICE_IP=your_idevice_ip THEOS_DEVICE_PORT=22
Then quit and reopen Terminal. If any of the following commands fail with regards to $THEOS
, you did not do this first step correctly.
$THEOS
is a macro for the directory where Theos is installed (usually/opt/theos
). So when you see something likecp foo $THEOS/bin/foo
, it means "copyfoo
from the current directory to$THEOS/bin
")
Now, assume administrator privileges by typing su
and entering your password, or some of the following commands will fail. If you do this then close that Terminal window, you will have to do this again to reassume administrator privileges.
Clone Theos:
git clone git://github.com/theos/theos.git $THEOS
Install ldid:
brew install ldid
... or download it from here and move it to $THEOS/bin
(make sure it's still named ldid
). Here is a terminal command to move it, where path_to_ldid
is wherever the ldid
binary is on your system:
mv path_to_ldid $THEOS/bin/ldid
Install wget
from Homebrew (if you do not have Homebrew installed, Google "install Homebrew for OS X"):
brew install wget
Then paste the following into Terminal:
wget http://apt.saurik.com/debs/mobilesubstrate_0.9.6011_iphoneos-arm.deb
mkdir substrate
dpkg-deb -x mobilesubstrate_0.9.6011_iphoneos-arm.deb substrate
mv substrate/usr/lib/* $THEOS/lib/
cp substrate/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate $THEOS/lib/libsubstrate.dylib
cp substrate/Library/Frameworks/CydiaSubstrate.framework/Headers/CydiaSubstrate.h $THEOS/include/substrate.h
rm -r substrate
This simply downloads substrate and adds a few required files to your Theos installation.
Now you should be able to create a new Theos project by typing nic.pl
or $THEOS/bin/nic.pl
. If you need additional runtime headers you will have to find them on your own. Throw them in $THEOS/include
.
If you're getting a weird dpkg-deb: unknown compression type 'lzma'
error, and if you just followed this guide you probably are, see this. Basically you have the new version of dpkg-deb and Cydia uses an old one, and the new one defaults to lzma compression instead of gzip. This can be fixed by editing the file at /opt/theos/makefiles/package/deb.mk
to use gzip instead. All I had to do was change the _THEOS_PLATFORM_DPKG_DEB_COMPRESSION
variable to gzip
.
Link to an install script that may be helpful: https://gist.github.com/tom-go/3342263
@wolfposd: fixed
@Dershowitz:
include
folder in your theos installation.