get unstuck, in time

13 August 2008

Jailbroken iPhone logging basics

Graphical apps on iphoneos 2.0 can't be started from the command line, which makes using stdout and stderr for logging a bit difficult. Or, more to the point, useless. You also can't see any messages that might occur if any app, GUI or non-, crashes. There are a couple of tips being passed around to address this. This one I've copied from the technique used to run Java apps. To get stdout logging, simply rename your executable and replace it with a wrapper shell script whose output you can pipe to a log file of your choosing, like this: #!/bin/bash exec "$(dirname "$0")"/MyRenamedExecutable &> /tmp/myapp.log That gives you printf() (or System.out.println() if you're so inclined). To get error messages, you can set up syslogd to run: straightforward instructions here. Note that after configuring syslogd, you'll need to reboot. You could do this the hard way, by holding down the power button for a few seconds and then sliding the touchscreen prompt. Or if you're impatient like me, you could just type reboot from the command line. Now to figure out why none of my apps are working...


Post a Comment

<< Home

Copyright (C) 2001-2008