我可以在 Xcode 4 中禁用调试器吗?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/6922408/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 21:38:49  来源:igfitidea点击:

Can I disable the debugger in Xcode 4?

xcodedebuggingidexcode4

提问by slavlazar

I would like to not use the debugger (gdb), though I want to get output from my application (from stdout and stderr).

我不想使用调试器 (gdb),但我想从我的应用程序(来自 stdout 和 stderr)获取输出。

I find that I never use it, I always use NSLog(or, for C printfand for C++ std::cout).

我发现我从不使用它,我总是使用NSLog(或者,对于 Cprintf和 C++ std::cout)。

How can I disable the debugger (even in the debug configuration)?

如何禁用调试器(即使在调试配置中)?

回答by Kunal

Next to run and stop - click on the Scheme area, select edit scheme - then on build configuration select release.

接下来运行和停止 - 单击方案区域,选择编辑方案 - 然后在构建配置上选择发布。

Not sure if that what you meant.

不确定这是否是您的意思。

回答by slavlazar

In XCode 4 - at the top left where the Run and Stop buttons are, there's a drop down selection (the Scheme selection), click on the left drop down and then 'Edit Scheme...'Next, locate and click on your Debug scheme (should be titled 'Run YourAppName.app') on the left. Now in the main content area, click on the 'Info'tab and change your Debugger selection to None- save your settings by clicking OK

在 XCode 4 中 - 在运行和停止按钮所在的左上角,有一个下拉选择(方案选择),单击左侧下拉菜单,然后单击“编辑方案...”接下来,找到并单击您的调试方案(应命名为'Run YourAppName.app')在左侧。现在在主要内容区域中,单击“信息”选项卡并将您的调试器选择更改为- 单击确定保存您的设置

XCode 4 turn off Debugger in Debug scheme

XCode 4 在调试方案中关闭调试器

回答by Joshua Nozzi

If you mean the debugger console, then you can control whether it automatically appears using the Behaviors preference panel. If you want to see the output, you can instead have Xcode automatically navigate to the current run log (also controlled by Behaviors) on launch or (I think) as soon as there's any output.

如果您指的是调试器控制台,那么您可以使用“行为”首选项面板控制它是否自动出现。如果您想查看输出,您可以让 Xcode 在启动时或(我认为)有任何输出时自动导航到当前运行日志(也由行为控制)。

If you reallymean to say you don't use the debugger in general (pausing at breakpoints and examining variables, stepping through code, etc. then you're hurting yourself in a way that makes most developers cringe. It's like a carpenter boldly proclaiming he doesn't use the equivalent reality-checking tools: a tape measure and level. I hope I misunderstood you there.

如果你真的想说你一般不使用调试器(在断点处暂停并检查变量,单步执行代码等)那么你正在以一种让大多数开发人员畏缩的方式伤害自己。这就像一个木匠大胆地宣称他没有使用等效的现实检查工具:卷尺和水平仪。我希望我在那里误解了你。

回答by yoAlex5

XCode Version 9.2

XCode 9.2 版

Project name -> Edit Scheme... -> Run -> deselect "Debug executable"

项目名称 -> 编辑方案... -> 运行 -> 取消选择“调试可执行文件”

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明