Skip to content

Instantly share code, notes, and snippets.

Last active July 22, 2018 02:50
  • Star 31 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A simple lldb module for adding an "fsa" command to inject F-Script anywhere into any process
Automate loading of F-Script Anywhere into any app.
By Daniel Jalkut - @danielpunkass -
To set up:
0. Make sure you have FScript.framework installed in /Library/Frameworks (
1. Copy this script to ~/.lldb/
2. Add the following to your ~/.lldbinit file:
command script import ~/.lldb/
To use:
1. Attach to a process e.g. by "lldb -n TextEdit"
2. Type "fsa" to load an initialize F-Script Anywhere in the context of the app.
3. Type "c" to continue execution of the target app.
def loadFSA(debugger, args, result, internal_dict):
debugger.HandleCommand('expr (void) [[NSBundle bundleWithPath:@"/Library/Frameworks/FScript.framework"] load]');
debugger.HandleCommand('expr (void)[FScriptMenuItem insertInMainMenu]');
def __lldb_init_module(debugger, dict):
debugger.HandleCommand('command script add -f fsa.loadFSA fsa');
Copy link

PS: Added a shortcut for Console and Objects Browser on (and a convenience method to use heredocs for lldb commands)

Copy link

@ifonefox : Me too, I'm getting a "Undeclared identifier" for NSBundle...

Copy link

@ifonefox @perfaram Same. How can this be fixed?

Copy link

hankbao commented Jan 13, 2016

try this in lldb: expr @import Foundation

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