Go to Pay4Bugs.com

The Pay4Bugs Blog

Pay4Bugs is the original pay per bug software testing marketplace. Our testers seek out and report problems with your software or website before they cause you to lose sales and customers.

Easy way to view debug logs from an iPhone App

Posted by C.S. Hsia on · Comments

What's the quickest and easiest way to view debug logs for my iPhone application? This question was actually raised by one of our clients, so I thought it would be useful to share the answer here.

As a developer, you want detailed software testing feedback from testers. This is information that you can immediately use to pinpoint the problem. Broken links, misaligned images, calculation errors, etc. These are all quite obvious.

However, testing apps on mobile devices is a different matter. Because there are so many factors involved: device OS version, whether it's jailbroken, language setting, carrier, Wifi or 3G..... the list goes on. With so many moving parts, we frequently see reports from users that something "just crashes".

Much like explaining a rattling dashboard to a service mechanic, problems like this seem to never appear when you are deliberately trying to replicate it. Plus the more desperately you try to crash something, the less likely you'll remember how to replicate it, once more.

For iPhone apps, it means it is time to fire up the debugger.

Obviously, we still want to test on the device, not simulator, for the realistic usage experience. Therefore the best way for internal testing of the iPhone app is to do so by running the app from xcode and connected to the debugger.

A basic but powerful tool - The Debug Screen.

  1. To do so, connect the device to the Mac as and run as normal (debug and release builds do not make a difference in this instance)
  2. Build and run the app.
  3. Press Command + shift + R to open the debugger console.

Simple right? Now go ahead and mess with the app with your evil intentions, but this time all your actions are logged. If you crash the app, simply look up at the screen to see what happened.

Alternately, you could consider writing debug information directly to the user's device, then transmit it back to the developers either by prompting users that there's been a crash or transparently in the background the next time the app is launched. There are pros and cons, and that is something we'll cover in a future entry.