06/05/10 12:24 Filed in: iPhone
As everyone knows, you can’t run gdb on an iPhone/iPod (and I assume, iPad) that’s not tethered to your development machine.
This really sucks if you are trying to debug an app that relies on or controls an external accessory; you’re basically working blind unless you want to litter your iPhone screen with UIAlertViews. That approach works for very isolated bits of code, but if you have repetitive events or lots of points in your code you need inspect, it gets old fast.
So, after procrastinating a couple of months, I’ve whacked together a simple wireless logger class that should be easy to dump into your code base. Using the Acceleromater Simulator
code as a template, I created for general use the WLog singleton.
The WLog class supports sending NSString messages to another computer via UDP broadcast, which means via WiFi when you’re using it for an iPhone/iPod/iPad app. All the receiver has to do is listen to a prescribed port. I chose the default port to be 5169 since it’s part of an unreserved block of port numbers.
The source files for a simple iPhone test app and a Java receiver are available at GitHub