Skip to main content
Inspiring
March 29, 2012
Question

Debugging an iOS crash?

  • March 29, 2012
  • 2 replies
  • 1702 views

What's the best way to debug an app when it consistently crashes on the iPad?

I launch my app from Flash Builder using the debugger mode so I can see all of the trace statements. However, when the app crashes, nothing appears in the debugging console within Flash Builder to indicate there is a bug in the code.

I'm sure I can create break points in the code to see exactly where it crashes, but is there a faster/better way to find the problem?

thanks,

Jack

This topic has been closed for replies.

2 replies

Colin Holgate
Inspiring
March 29, 2012

When I had to track down such crashes on iPad I just did a lot of trace statements. I was able to tell that the crashes happened when going from one heavy graphics scene to another heavy graphics scene. The iPad 1 doesn't like that.

Look at what is going on before and after when the crash happen. In my case I realized that some graphics were twice the resolution they needed to be.

Inspiring
March 31, 2012

I ended up using trace statements and found my problem. It was one line of code. For some reason using the cacheAsBitmapMatrix property in the below manner was crashing the app.

_spBG.cacheAsBitmapMatrix = _spBG.transform.concatenatedMatrix;

I use this property elsewhere in the app but those instances haven't crashed the app (yet, at least). My only guess in what the difference could be is that when I use this property when the app crashed, I used it to create 16 graphics that are created all at the same time. So there were 16 calls to this property. When I use this property elsewhere (where the app did NOT crash), I may only call it for 2 graphics at one time. So perhaps there is a limit as to how many times you can call cacheAsBitmapMatrix. Or perhaps there is another reason why this one line of code crashed the app.

In any case, I noticed that using the cacheAsBitmapMatrix property in this instance was not needed, so I didin't have to call it. Thus I solved my crashing problem.

Thanks for the replies!

Pahup
Adobe Employee
Adobe Employee
April 2, 2012

Hi,

Glad to know that you've been able to resolve the crash by working around it, it'll be great if you could help us investigate the issue.

Would it be possible for you to share a sample swf/xml with sources which demonstrates the issue.

-Thanks

Pahup

Participating Frequently
March 29, 2012

Monster Debugger http://demonsterdebugger.com/ is by far the best debugging tool I've found for mobile device testing with AIR. The tutorial covers the whole installation process.

Basically you include the swc when building the app and then you can monitor you app running on your mobile using a nifty AIR app on your desktop. The debugger communicates over wifi so you just need your computer and mobile to be connected to the same wifi network.

The debugger picks up all your normal Flash type errors and even lets you inspect elements on the fly.