#Loading Tweaks in the Simulator
With the latest updates to the simulator, this turns out to be pretty simple:
You need to be using kirb/theos
In order not to require MobileSubstrate to be loaded and your tweak to be compiled for i386/x86_64, add
In your makefile:
TARGET = simulator:clang:latest:7.0
tweakname_USE_SUBSTRATE = 0
Then run the simulator and enter in terminal:
xcrun simctl spawn booted launchctl debug system/com.apple.SpringBoard --environment DYLD_INSERT_LIBRARIES=.theos/obj/debug/Blah.dylib
xcrun simctl spawn booted launchctl stop com.apple.SpringBoard
(from conradev)
This should work for any process, though I havent tried.
DYLD_INSERT_LIBRARIES is a colon seperated list, so multiple dylibs can be loaded.
If deploying to the iOS 9 simulator you'll need to replace
#if TARGET_IPHONE || TARGET_IPHONE_SIMULATOR
with
#if TARGET_IPHONE || TARGET_OS_SIMULATOR
in $THEOS/prefix.pch as TARGET_IPHONE_SIMULATOR is deprecated in iOS 9 (fixed in the latest version of kirb/theos)
If you're having any further problems it's probably due to a dodgy theos setup - I'd recommend installing fresh from kirb/theos
Any way to load PreferenceBundles too? Need to test a tweak with settings!