These 2 methods worked well enough for me. Please note that in my example, I manually run "SomeApp" to monitor it as soon as it starts.
gdb (gdb) attach --waitfor 'SomeApp' **this is where you manually start SomeApp on your device** call (void)instrumentObjcMessageSends(YES)
"instrumentObjcMessageSends" enables / disables message logging from the runtime. Here is some more information about this method.
Another option that uses GDB again on your iDevice is to write a small command like this:
FooPad:~ root# gdb (gdb) attach SBSettings Attaching to process 440. Reading symbols for shared libraries . done Reading symbols for shared libraries ............................. done 0x35686004 in mach_msg_trap () (gdb) break objc_msgSend Breakpoint 1 at 0x3323ef72 (gdb) commands Type commands for when breakpoint 1 is hit, one per line. End with a line saying just "end". >printf "-[%s %s]\n", (char *)class_getName(*(long *)$r0,$r1),$r1 >c >end (gdb) c Continuing.
As soon as you press "c" (right above the line that reads "Continuation"), your screen will populate function names and arguments.
Finally, follow these instructions to get a working GDB on your iDevice. For posterity, I will post short instructions here:
The GNU Debugger (gdb) is used to analyze the runtime behavior of an iOS expression. In recent iOS versions, booted Cydia's GNU Debugger is broken and does not work properly. After Post Pod 2g also did not help me.
To get rid of this problem, add http://cydia.radare.org to the cydia source and download the latest GNU debugger (build 1708). Creating GDB 1708 works for iOS 5.x.
source share