在 Xcode 中更改工作目录 [英] Change the working directory in Xcode

查看:35
本文介绍了在 Xcode 中更改工作目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设法使用 cmake -G Xcode 在 Xcode 中运行我的 C++ 项目.现在我想调试它,因为它提供了很好的 gdb 前端.

I managed to get my C++ project running in Xcode using cmake -G Xcode. Now I would like to debug it, because of the nice gdb fronted it provides.

但是我需要更改执行 gdb 的工作目录,否则它将无法工作.(它需要从与工作目录路径相关的文件中读取一些数据)我能做的是在 gdb 停止输入 cd working_dir 然后手动输入 r 运行它之后.这有效,但 Xcode 会不断抱怨,也不是一个优雅的解决方案.

However I need to change the working directory where gdb is executed otherwise it wont work. (It needs to read some data from files relative to the path of the working directory) What I can do is after gdb has stopped typing cd working_dir and then run it manually typing r. This works, but Xcode will complain constantly and is also not an elegant solution.

所以在构建设置的某个地方我应该能够设置工作目录..但是在哪里?!

So somewhere in the build settings I should be able to set the working directory..but where?!

推荐答案

刚刚将此解决方案更新到 XCode 4.x

Just updating this solution to XCode 4.x

你继续产品 -> 方案 -> 编辑方案

You go on Product -> Scheme -> Edit Scheme

在选项卡上选择您的工作目录.

On the tab Options you choose your working directory.

这篇关于在 Xcode 中更改工作目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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