Skip to content

Instantly share code, notes, and snippets.

@MiRO92
Forked from friggog/Simulator_Tweaks.md
Created September 23, 2015 20:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MiRO92/000a9930d7c6b53cd6ee to your computer and use it in GitHub Desktop.
Save MiRO92/000a9930d7c6b53cd6ee to your computer and use it in GitHub Desktop.

#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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment