Showing posts with label Instruments. Show all posts
Showing posts with label Instruments. Show all posts

Thursday, May 5, 2011

Debugging Tutorial – Automating Your Tests With A UIRecorder Instrument

If you have ever experienced a bug in your application that took many steps to reproduce, then this tutorial is for you.  By nature, testing and debugging are very tedious processes.  This is especially the case for the iPhone.
Say you have an app that drills down 5-levels deep to some other view.  Now let’s say that you have a bug on that view 5 levels deep.  Your normal method of debugging is:
  • Run the app
  • Tap view 1
  • Tap view 2
  • Tap view 3
  • Tap view 4
  • Tap view 5
  • (Crash)
  • Change some code
  • Repeat
As you can see (and I’m sure have noticed), this sucks.  Well, Kendall Gelner gave a killer talk at 360iDev (which I recently attended) on various debugging tips using Instruments and XCode.  One of the most useful techniques (to me) was how to automate your testing.  Let me show you what I mean.

1. Open up the app you wish to test/debug
2. Launch it in the simulator
3. Open Instruments – This is located in /Developer/Applications/Instruments (just do a spotlight search for it)