Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Debug MobileSubstrate Tweaks?

What is the best way to debug MobileSubstrate extensions, i.e. placing breakpoints etc.? Is there away to do this in Xcode? GNU Debugger?

like image 283
Zigsaz Avatar asked Jan 20 '23 04:01

Zigsaz


2 Answers

I use the syslog and tail. You'll need syslogd and Erica Utilities from Cydia. Then throughout your tweak place NSLog(@"breakpoint 1 - %@", someObject); and run the tweak.

tail -f /var/log/syslog
like image 96
EvilPenguin Avatar answered Jan 28 '23 01:01

EvilPenguin


#define Debugger() { kill( getpid(), SIGINT ) ; }

Then you just call Debugger() wherever you want to place a breakpoint.

You can also raise an exception if you want to trace the stack:

[NSException raise:@"Exception Message" format:formatString];
like image 27
pedrodevoto Avatar answered Jan 28 '23 00:01

pedrodevoto