a. Specify xcode (according to your own xcode path):
sudo xcode-select -s/Applications/Xcode.app/Contents/Developer
b. Download Theos (export is important):
export THEOS=/opt/theos sudo git clone git://github.com/theos/theos.git $THEOS
d. Configure CydiaSubstrate:
Attention The new version of Theos please skip directly. Run Theos Automation Configuration Script to extract CydiaSubstrate directly using iFunBox
Use iFunBox and other tools on the iPhone to put it on iOS
/Library/Frameworks/CydiaSubstrate.framework/CydiaSubstrateCopy it to your computer and rename it to libsubstrate.dylib and copy it to /opt/theos/lib.
e. Configure dkpg
Deb is the standard format for jailbreak development installation packages, and dpkg-deb is a tool for manipulating deb files. With this tool, Theos can properly package the project into deb packages. Download dm.pl from [Download] (https://raw.githubusercontent.com/DHowett/dm.pl/master/dm.pl) and rename it to dpkg-deb (if the suffix is still .pl, display Can be modified in the introduction), Put it in the "/opt/theos/bin/" directory and set its executable permissions: sudo chmod 777 /opt/theos/bin/dpkg-deb In fact, Theos is already a tweak development environment, but since it is used only because it needs to compile tweak, many of its subsequent configurations are not explained in detail.
Input /opt/theos/bin/nic.pl NIC 2.0 - New Instance Creator ------------------------------ [1.] iphone/activator_event [2.] iphone/application_modern [3.] iphone/cydget [4.] iphone/flipswitch_switch [5.] iphone/framework [6.] iphone/ios7_notification_center_widget [7.] iphone/library [8.] iphone/notification_center_widget [9.] iphone/preference_bundle_modern [10.] iphone/tool [11.] iphone/tweak [12.] iphone/xpc_service Choose a Template (required): Choose[11.] iphone/tweak Choose a Template (required): 11 Project Name (required): iOSREProject Package Name [com.yourcompany.iosreproject]: com.yuhao.iosreproject Author/Maintainer Name [yuhao]: sthyuhao [iphone/tweak] MobileSubstrate Bundle filter [com.apple.springboard]: com.apple.springboard [iphone/tweak] List of applications to terminate upon installation (space-separated, '-' for none) [SpringBoard]: SpringBoard Instantiating iphone/tweak in iosreproject/... Done. The first one is equivalent to the name of the project folder The second is equivalent to the bundle id The third is the author The fourth is the bundle identifier of the active object. The fifth is the application to be restarted.
After completing these steps, an iosreproject folder is generated in the current directory, which is the tweak project just created.
release Because Tweak default encoding is MRC
If you need ARC, insert it in MakeFile
TweakName_CFLAGS = -fobjc-arc
Need to be executed in the terminal before Tweak injection
export THEOS=/opt/theos/ Export THEOS_DEVICE_IP=xxx.xxx.xxx.xxx (ip address of the phone)
make package install