Why do release builds sometimes crash while debug builds do not?

百般思念 提交于 2019-12-02 14:18:35

问题


I figured out that my app crashes on many occasions with the release build (for instance the build for TestFlight). But the debug build does not.

Why is this even possible? What makes a release build so different from the debug build? And how can I figure out what is causing the crash in a release build?

I modified my Run scheme to use the TestFlight build configuration, and when I use this, the app crashes. Xcode also can't attach itself to the app after installing and running it on the device.


回答1:


There are a number of possible reasons - if you're running your debug builds from XCode the application watchdog is disabled to allow the debugger to attach. In normal circumstances your app can be terminated if it fails to launch within a certain timeframe. Other potential causes could be third-party libraries you are using having different release/debug settings. Without knowledge of your app it's very difficult to say what the root cause is.

The good news is that whilst you can 'debug' a release build from within XCode you can use it to symbolicate your release build crash logs. This will give you the exact line number where the crash is occurring, and help you track down the problem.



来源:https://stackoverflow.com/questions/14977436/why-do-release-builds-sometimes-crash-while-debug-builds-do-not

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!