简体   繁体   中英

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM