simject is a command-line tool and iOS dynamic library that allows developers to easily test their tweaks on the iOS Simulator.
simject is BSD-licensed. See LICENSE for more information.
simject setup (requires the latest version of Theos)
-
git clone https://github.com/angelXwind/simject.git -
cd simject/ -
make setup -
Note: During the process, you will be asked by
sudoto enter in your login password. Please note that it is normal for nothing to be displayed as you type your password.
-
Place your dynamic libraries and accompanying property lists inside
/opt/simjectto load them in the iOS Simulator. Do not deletesimject.plistorsimject.dylib. -
Inside the
binsubdirectory, you will find therespring_simulatorcommand-line tool. Execute it to cause a booted iOS Simulator to respring and be able to load tweaks. -
You will need to run
respring_simulatorevery time the device reboots or if SpringBoard crashes. -
Happy developing! (And don't make SpringBoard cry too hard... it has feelings, too! Probably.)
-
Open your project's
Makefile. -
Change your
TARGETvariable toTARGET = simulator:clang(you may optionally specify the SDK/deployment versions) -
If you want to support 32-bit iOS Simulators (in addition to 64-bit), add
ARCH = x86_64 i386to your Makefile. If you are fine without 32-bit support, then simply addARCH = x86_64. -
makeyour project and copy.theos/obj/iphone_simulator/$YOUR_TWEAK.dylibto/opt/simject/$YOUR_TWEAK.dylib -
Also make sure to copy
$YOUR_TWEAK.plistto/opt/simject/$YOUR_TWEAK.plist. simject will not load your tweak if you miss this step! -
An example tweak project is available in the
simjectExampleTweak/subfolder. Use it as reference if you want.
Do keep in mind that just because your tweak works in the Simulator doesn't necessarily mean it'll work on an actual iOS device. Yes, in 99% of cases, it will work just fine, but there will always be some strange edge cases where this does not apply.
Also, special thanks to PoomSmart, who told me about the existence of -[SBApplicationInfo environmentVariables], which is crucial to how simject works.