简体   繁体   English

调试时应用程序不会崩溃

[英]App is NOT Crashing While Debugging

I am facing a strange issue in my currently working app.我在当前工作的应用程序中遇到了一个奇怪的问题。 App is crashing when we install app through diawi or directly install using .ipa .当我们通过 diawi 安装应用程序或使用 .ipa 直接安装时,应用程序崩溃。 But I am not able to regenerate the issue through debugging.但是我无法通过调试重新生成问题。 I am totally confused and how can I solve the issue?我很困惑,我该如何解决这个问题?

I am using Xcode 8.2.1我正在使用 Xcode 8.2.1

You can try building the app in Xcode in the Release configuration instead of the Debug configuration.您可以尝试在 Xcode 中的 Release 配置而不是 Debug 配置中构建应用程序。

You do this by你这样做

  • clicking on your app name at the top left (near where you press to run the app)单击左上角的应用程序名称(靠近您按下以运行应用程序的位置)
  • choosing 'Edit Scheme' from the drop down从下拉菜单中选择“编辑方案”
  • clicking on the disclosure indicator by 'Run'通过“运行”点击披露指示器
  • choosing 'Run' from the three choices which appear从出现的三个选项中选择“运行”
  • there is a drop down called 'Build Configuration'.有一个名为“构建配置”的下拉菜单。 This will almost certainly be set to Debug.这几乎肯定会设置为调试。 Set this to Release.将此设置为发布。

Now when you run your app you will be building a far more optimised version - this is the version you build when you are submitting to Apple.现在,当您运行您的应用程序时,您将构建一个更加优化的版本——这是您提交给 Apple 时构建的版本。 It's just the same app optimised for speed/memory instead of debugability.它只是针对速度/内存而不是可调试性进行了优化的同一个应用程序。

Hopefully, you should be able to reproduce your crash in Xcode now.希望您现在应该能够在 Xcode 中重现您的崩溃。 However, you'll notice that you get far less debugging information when you hit your crash - this is because Debug builds have lots of extra information in (and are much less optimised by the compiler) specifically to make debugging easier.但是,您会注意到,当您遇到崩溃时,获得的调试信息要少得多——这是因为调试构建中有很多额外的信息(并且编译器的优化程度要低得多),专门用于使调试更容易。 Being able to reproduce the crash in Xcode should give you a few more clues as to what's going on.能够在 Xcode 中重现崩溃应该会给你更多关于发生了什么的线索。 At the least you should be able to see the chunk of code causing you issues.至少您应该能够看到导致您出现问题的代码块。

Let us know how you get on.让我们知道您的身体情况如何。

使用崩溃跟踪工具来跟踪崩溃这里是有关安装crashlytics的详细信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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