Debugging in XCode
Monkey Targets Forums/iOS/Debugging in XCode
| ||
I have a bug that is crashing the game on my iPhone but not my iPad or the simulator. Is it possible to set up Xcode so you can see what part of the code the game crashes on? |
| ||
Running with the iPhone hooked to the Mac should do the trick as you can see what's going on with gdb. |
| ||
I have a bug that is crashing the game on my iPhone but not my iPad or the simulator. You might be running out of RAM, how much does the iPhone have? |
| ||
I think you're right, it has 256mb RAM but I do get a memory warning before it crashes. I've been busy packing all my images into textures ( http://monkeycoder.co.nz/Community/posts.php?topic=1155 ) and I may scale a few backgrounds down too. I realised that you need to build the iOS version in Monkey with the Debug flag on so that it includes the line numbers in the iOS code. The memory crash wasn't being caught by the debugger though, it was happening at random points. |
| ||
Keep us posted! |
| ||
256 is a lot of RAM.. are you creating a lot of objects? It could be the usage of strings, all those strings that are used to save the game might still be in memory try playing the game without saving it and see if it crashes |
| ||
Actually, the memory warning does seem to appear when the game creates the season fixtures which is a lot of data. Will test some more tomorrow. |
| ||
Usually how its worked on iOS is that since there's many other background apps running at the same time using memory, it's not safe to use any more than 50% of the total RAM. So it might crash if you go above 128 MB ram usage on those devices. In Xcode, if you click on "Profile" instead of "Build", it will open Instruments. Choose "Activity Monitor" to see the memory usage and other info. You need to have a device connected to Xcode. |
| ||
Ooh, that's handy! Seems that the memory peaks at around 120mb. It has stopped crashing since scaling down some background images so I guess it was exceeding that amount in the earlier version. The memory warning still occurs which is a bit of a worry but it feels stable when playing the game. |
| ||
The amount of usable graphics memory vs. total memory is significantly less, and it differs on each phone so while it may still work on your phone it might crap out on an older device. Looks like you really need to get the mem usage down.. 120mb is huge. |
| ||
I'm not sure what's going on. The entire build is less than 20 meg and the save file is less than 1mb... Need to determine what is causing the excessive amount. |
| ||
remove the code that saves the game and see what happens |