Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: 检测 iOS 应用程序是否在调试器中运行
当我的程序从 Xcode Debugger 启动时(相对于直接从模拟器或设备启动),我想添加一些特殊的处理代码。当 Xcode 启动一个程序进行调试时,它会设置一个环境变量吗?
最简单的方法是编辑调试方案以传递命令行类型参数,并在 main() 中检测它。