你如何在 Xcode 4 中指定命令行参数?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5025256/
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
How do you specify command line arguments in Xcode 4?
提问by Joshua Olson
I just upgraded to Xcode 4 and can't find much documentation on it yet, since it just went gold master. I need to specify a command line argument for testing my application.
我刚刚升级到 Xcode 4,还没有找到太多关于它的文档,因为它刚刚成为金牌大师。我需要指定一个命令行参数来测试我的应用程序。
The Xcode 3.2 advice doesn't help since everything got moved around.
Xcode 3.2 的建议无济于事,因为一切都被转移了。
回答by CedricSoubrie
Command line arguments and environment variables can be set up in the Run section of the scheme editor.
Product -> Edit Scheme... -> Run -> Arguments
(Copy-Paste from the link given by Jano)
命令行参数和环境变量可以在方案编辑器的运行部分设置。
产品 -> 编辑方案... -> 运行 -> 参数(从 Jano 提供的链接复制粘贴)
回答by Merlin
The shortcut cmd+ <works too. (Default shortcut)
快捷方式cmd+<也有效。(默认快捷方式)
On Xcode 7 (updated), XCode 10.1
在 Xcode 7(更新)上,XCode 10.1
Shortcut : Shift+ cmd+ <
快捷方式:Shift+ cmd+<