Game only works on iPhone when connected with xCode

This is really weird. I have been working on the same game for a few months now. Today this problem started. I can build the game directly to my iPhone 3GS that’s connected to the Mac and it runs with no problems on the phone after it builds in xCode with the Run button.

Now after I click Stop in xCode or press the Home button on the phone - then start the game again on the phone, it pauses for several seconds, then exits the game (never shows the first scene). I have no idea what’s going on or how to troubleshoot. It should still be the same game that got installed by xCode. Why would it not work while not being debugged by xCode? I already tried “slow and safe” and it doesn’t change anything.

And how can I read somewhere what problem is happening?
By the way, my iPad2 does not have this problem with today’s build. If it matters, my game size is 41Mb today. It’s gotten a lot larger recently…

Most likely you are hitting the case described on Unity Manual Troubleshooting page: Unity - Manual: Troubleshooting . Just take a look at “Game runs fine when launched from Xcode and crashes on first level load when launched manually on the device.” section on that page.

Swittch to Fast and no exception in your build settings. That should also crash connected to your mac and you can debug easier this way :slight_smile:

Sounds like its using too much ram

No it didn’t :frowning:

I think this problem can happen if your initial scene takes a long time to load. The ‘fix’ is to have a small boot scene that loads your initial scene. This worked for me.

Good tip. I already have one of those though :expressionless:

Hi there, what about device logs? in the organizer you can see the logs of the apps, I guess unity logs will be there? (by the way I don’t have iOS version so this is the only advice I could give… and so I don’t know if there exist .m files you can trace with NSLog).

The problem had to do with the compression or decrompression of a large mp3 on the opening scene.
Thanks for the ideas everyone! It’s now solved.