为什么有时发布版本会崩溃而调试版本却不会崩溃? [英] Why do release builds sometimes crash while debug builds do not?

查看:90
本文介绍了为什么有时发布版本会崩溃而调试版本却不会崩溃?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现发布版本(例如TestFlight的版本)在很多情况下会导致我的应用崩溃.但是调试版本没有.

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?

我修改了运行方案以使用TestFlight构建配置,当我使用它时,应用程序崩溃.在设备上安装并运行Xcode之后,Xcode也无法将其自身附加到应用程序上.

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.

推荐答案

有很多可能的原因-如果您正在从XCode运行调试版本,则会禁用应用程序监视程序以允许调试器进行附加.在正常情况下,如果您的应用无法在特定时间内启动,则可以终止该应用.其他可能的原因可能是您使用的第三方库具有不同的发行版/调试设置.没有您的应用程序的知识,很难说出根本原因是什么.

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.

好消息是,尽管您可以从XCode内部调试"发行版,但您可以 使用它来象征发行版的崩溃日志.这将为您提供发生崩溃的确切行号,并帮助您查找问题所在.

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.

这篇关于为什么有时发布版本会崩溃而调试版本却不会崩溃?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆