Skip to content

Instantly share code, notes, and snippets.

@airdrummingfool
Forked from chrismiles/reveal.py
Last active August 29, 2015 13:57
Show Gist options
  • Save airdrummingfool/9557081 to your computer and use it in GitHub Desktop.
Save airdrummingfool/9557081 to your computer and use it in GitHub Desktop.
""" File: reveal.py
1. Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
2. Add Run Script Build Phase to copy libReveal.dylib into the bundle
(see https://gist.github.com/airdrummingfool/9557257)
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint
Symbol: "UIApplicationMain"
Action: Debugger Command with value "reveal"
Tick "Automatically continue after evaluating"
"""
__author__ = 'Chris Miles'
__modified-by__ = 'Tommy Goode'
__copyright__ = 'Copyright (c) Chris Miles 2013'
__license__ = 'MIT'
def auto_load_reveal(debugger, command, result, dict):
debugger.HandleCommand('call (void*)dlopen((char*)[(NSString*)[(NSBundle*)[NSBundle mainBundle] pathForResource:@"libReveal" ofType:@"dylib"] cStringUsingEncoding:0x4], 0x2)')
def __lldb_init_module(debugger, internal_dict):
debugger.HandleCommand('command script add -f reveal.auto_load_reveal reveal')
@anefkens
Copy link

Small addition, I only have the issue when I try to debug on a device. On the simulator it just works.

Since I'm debugging layout issues on a device that has to have BTLE connectivity.

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