Game freezes when waking up from suspend (often, but not always)

I’m looking for your advice on how to troubleshoot this. About 25% of the time that I lock my phone while the game is open, when I unlock the phone later, the game is frozen. I haven’t been able to pin down any pattern for when this happens, but it seems like it can happen in any scene, not just the main gameplay scene with lots of action. The screen will be black for a while, after which I’ll get the system “App is not responding. Wait or Close” popup.

This is a Verizon Moto X running Android 4.4.4

Currently, I only handle suspend/resume events in the main gameplay scene, where I pause the game on applicationSuspend, and do nothing on applicationResume. The listener is created on enterScene and removed on exitScene (I’m still using storyboard). The game never has this sort of issue when it’s open and running.

Any thoughts on how/where to add logging, possible culprits, or how to troubleshoot? 

Add a “debug” layer on top of your visual interface, with some elements that you can use to debug. I always put at least a text field completely on top of my app when coding, that I can use to display text about breakpoints etc…

That way you can test on device and change the text of this field to display info about resuming, sleeping etc… It’ll give you a good understanding of where your app stalls, for starters.

Add a “debug” layer on top of your visual interface, with some elements that you can use to debug. I always put at least a text field completely on top of my app when coding, that I can use to display text about breakpoints etc…

That way you can test on device and change the text of this field to display info about resuming, sleeping etc… It’ll give you a good understanding of where your app stalls, for starters.