|Windows Phone: debugging crashes in a released app
||[Jan. 19th, 2013|06:45 pm]
Unfortunately, bugs are a fact of life, and your app will probably crash occasionally in the wild. But, there are a few nifty tools to help you debug them after the fact.
I wrote about Little Watson a while ago, and while it's helpful, it does require the user to send in a report. Microsoft provides data in the Windows Phone Dev Center that doesn't require the user to do anything - here's how to use it!
Step 1: Get the data
Log in to the Windows Phone Dev Center and go to the Dashboard. At the bottom of the page there's a "Highlights" section that shows app downloads - click on the little arrows at the bottom to see crash count statistics:
(click for full image)
For the app you're interested in, click on the number next to it - in this case we're going to be looking at FlightPredictor.
Now you'll see a screen like this:
(click for full image)
Click on "Export stack traces" - this will download and open an Excel file with the crash data.
Step 2: Analyze the data
You should see something like this:
Go ahead and click the "Enable Editing" button at the top.
Most columns you see should be pretty self-explanatory. Note that "Mango" is OS 7.5 and "Apollo" is 8.0. The call stacks are grouped together - you can see in my example that the top row has 2 crashes, so it's the most common one.
For this crash the problem function is "Unknown", which isn't terribly helpful. So let's look at the full stack trace - move over to that cell and press F2 to see it (and press Up to get to the top of the text). And we see:
So we can see the most recent call in the stack is FlightPredictor.Model.Flight.UpdateCalculatedValues(), and hopefully the call stack will help you track down why the app is crashing.
I tried to use the offset to find what line of code the crash is happening on, but I couldn't make it match up with IL offsets or native offsets (see this MSDN thread). I'll update this post if I find out how to make it work.
See all my Windows Phone development posts.
I'm planning on writing more posts about Windows Phone development - what would you like to hear about? Reply here, on twitter at @gregstoll, or by email at email@example.com.