PART OF THIS DOCUMENT COMES FROM THEOS WIKI ON GITHUB.
What is theos?
Theos was initially “iphone-framework”, a project created to simplify building code at the command line for iOS devices (primarily jailbroken devices). It later underwent significant changes and became Theos, a flexible Make-based build system primarily for jailbreak software development, but also with complete support for building for other supported platforms. Theos runs on, and can build projects for, macOS, iOS, Linux, and Windows (under Cygwin or Windows Subsystem for Linux).
As of 2015, the project stalled as Dustin Howett was unable to devote time to it. It was since picked up by the community, adding many desired features and fixing issues. The legacy version of Theos that used to be located at DHowett/theos is permanently preserved on the legacy branch.
There is also documentation available for the original Theos at the iPhone Dev Wiki, and theos-ref; however be aware that not all information is updated for the changes Theos has undergone recently.
Installation on iOS (Revised)
This guide will help you install Theos on your iOS jailbroken device.
Platform | Minimum OS version | Targets supported |
---|---|---|
iOS | 5.0 | iOS |
All the commands shown on the following instructions are meant to be run as the "user" user, not root. Similarly, Theos is also meant to be run as a normal user, not root.
-
Install the following prerequisites:
- Sam Bingner’s repository
- Theos Dependencies (package on BigBoss repo, relies on the previous repository being installed first)
-
Set up the
THEOS
environment variable:echo "export THEOS=/opt/theos" >> ~/.profile
For this change to take effect, you must restart your shell. Kill the terminal app in the taskswitcher then re-open the terminal app and do
echo $THEOS
on your shell to check if this is working. If you don't want to log out or re-open, you can simply:source ~/.profile
Reason of changing
~/theos
into/opt/theos
: https://github.com/theos/theos/issues/460 -
Clone Theos to your device:
git clone --recursive https://github.com/theos/theos.git $THEOS
-
Get the toolchain:
Theos Dependencies installs iOS Toolchain.
-
Get an iOS SDK:
You can get patched SDKs from our SDKs repo.
curl -LO https://github.com/theos/sdks/archive/master.zip TMP=$(mktemp -d) unzip master.zip -d $TMP mv $TMP/sdks-master/*.sdk $THEOS/sdks rm -r master.zip $TMP
-
Install the Swift toolchain (optional):
swift-toolchain
is on the BigBoss repo.Note that the minimum SDK version required to compile Swift code is currently iOS 11.2.
iphone/tool
$THEOS/bin/nic.pl
接下来你会看到:
NIC 2.0 - New Instance Creator
------------------------------
[1.] iphone/activator_event
[2.] iphone/activator_listener
[3.] iphone/application_modern
[4.] iphone/application_swift
[5.] iphone/cydget
[6.] iphone/flipswitch_switch
[7.] iphone/framework
[8.] iphone/library
[9.] iphone/notification_center_widget
[10.] iphone/notification_center_widget-7up
[11.] iphone/preference_bundle_modern
[12.] iphone/theme
[13.] iphone/tool
[14.] iphone/tool_swift
[15.] iphone/tweak
[16.] iphone/tweak_with_simple_preferences
[17.] iphone/xpc_service
Choose a Template (required):
-
选择
13
或者14
, 填入合适的名称注意:
id
只能由小写字母和+-.
构成 -
在
Makefile
的最上方加入:THEOS_DEVICE_IP = 127.0.0.1
-
编译部署
make package install
在此之后,
binary
就会被安装到/usr/local/bin
当中,就可以直接运行。