问题
It is somewhat an awkward situation right now.
When I run my project directly from Xcode to my device it runs perfect without any crashs. But when I create an ipa file of that project and install that ipa into my device by using iTunes, only for the first time when I launch my gameplay screen it crashes, later on when I starts my gameplay it runs fine.
Remember, my gameplay starts after the user navigates 2 initial screens which works pretty fine in either conditions. (i.e running from Xcode or from ipa file).
What I dont understand is that if the problem is in my init method of the gameplay class why it does not crashes when I run it directly from Xcode. Is there any code compression or different mechanism of code compilation when running as an ipa or from Xcode.
Any help would be appreciated.
Thanks
回答1:
As adig said, get crashlog from device, then symbolicate it. You will see call stack and the line, that caused crash. All differences between release, debug, ad hoc, etc. build configuration you can setup in your project.
回答2:
I faced the same scenario, the ipa file was crashing after two initial screens. The crashlog did give the line of crash in the code. Debugging the code did not solve the purpose.
But I solved the issue by checking the Archive settings in the Edit Scheme section. My Build was in Debug mode and the Archive setting was Release, I changed the Archive's build configuration to Debug and created an ipa and the crash was resolved.
Hope this helps someone save productive time. Thanks.
来源:https://stackoverflow.com/questions/10477809/gameplay-crashes-from-ipa-file-but-runs-fine-from-xcode