Sunday, June 24, 2012

How to install thoes under Xcode 4.5 (iOS 6)

(1) Installation (note : you have to install Command Line Tools (Mountain Lion) for Xcode 4.5)
if you don't have Command Line Tools use
/Applications/Xcode.app/Contents/Developer/usr/bin/git
install_theos.sh    Select all
# clone theos.git cd ~ git clone git://github.com/DHowett/theos.git # clone iphoneheaders.git cd ~/theos/ mv include include.bak git clone git://github.com/rpetrich/iphoneheaders.git include for FILE in include.bak/*.h; do mv $FILE include/; done rmdir include.bak/ # get IOSurfaceAPI.h cd ~/theos/include/IOSurface/ curl -O -k https://raw.github.com/javacom/toolchain4/master/Projects/IOSurfaceAPI.h # clone theos-nic-templates.git cd ~/theos/templates/ git clone git://github.com/orikad/theos-nic-templates.git # get dpkg-deb for Mac OS X cd ~/theos curl -OL http://test.saurik.com/francis/dpkg-deb-fat chmod a+x dpkg-deb-fat sudo mkdir -p /usr/local/bin sudo mv dpkg-deb-fat /usr/local/bin/dpkg-deb # get ldid for Mac OS X cd ~/theos/bin curl -OL http://dl.dropbox.com/u/3157793/ldid chmod a+x ldid # get libsubstrate.dylib substrate.h cd ~/theos curl -OL http://apt.saurik.com/debs/mobilesubstrate_0.9.4001_iphoneos-arm.deb dpkg-deb -x mobilesubstrate_0.9.4001_iphoneos-arm.deb mobilesubstrate cp mobilesubstrate/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrate ~/theos/lib/libsubstrate.dylib cp mobilesubstrate/Library/Frameworks/CydiaSubstrate.framework/Headers/CydiaSubstrate.h include/substrate.h


Download and untar iPhoneOS5.1.sdk.tgz to Xcode
cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/
tar xzvf ~/Downloads/iPhoneOS5.1.sdk.tgz


(2) get preferenceloader.git for test build
mkdir -p ~/Projects
cd ~/Projects/
git clone git://github.com/DHowett/preferenceloader.git
cd ~/Projects/preferenceloader/



(3) Modify Makefile, change from

include framework/makefiles/common.mk

to

#export TARGET=iphone:latest:2.0
export ARCHS=armv7
include $(THEOS)/makefiles/common.mk
#include framework/makefiles/common.mk


(4) Test build preferenceloader
cd ~/Projects/preferenceloader/
export THEOS=~/theos
make
make package



(5.1) Clone IconRenamer Project
#get CaptainHook headers
cd ~/theos/include/
rm -fr CaptainHook
git clone git://github.com/rpetrich/CaptainHook.git
#get and build IconRenamer
cd ~/Projects
git clone git://github.com/rpetrich/IconRenamer.git
cd ~/Projects/IconRenamer
rmdir framework; ln -sf ~/theos framework

(5.2) Modify Makefile to

export TARGET=iphone:5.1
TWEAK_NAME = IconRenamer
IconRenamer_OBJC_FILES = IconRenamer.m
IconRenamer_FRAMEWORKS = Foundation UIKit

ADDITIONAL_CFLAGS = -std=c99

include $(THEOS)/makefiles/common.mk
include $(THEOS)/makefiles/tweak.mk

(5.3) Build IconRenamer

export THEOS=~/theos
cd ~/Projects/IconRenamer
make
make package


(6) Test build UICatalog
cd ~/Projects
svn co http://apiexplorer.googlecode.com/svn/trunk/UICatalog UICatalog
cd ~/Projects/UICatalog
sed '/^SYSROOT/d' Makefile.theos > Makefile
export THEOS=~/theos
make
make ipa


Please refer to this for the updated iOS7 tweaks http://iphonedevwiki.net/index.php/Updating_extensions_for_iOS_7 .
.
.