Changing the working directory in Xcode
I was able to run my C ++ project in Xcode using cmake -G Xcode. Now I would like to debug it due to the fact that it provided a good gdb.
However, I need to change the working directory where gdb is running, otherwise it won't work. (It needs to read some data from the files relative to the working directory path). What I can do is after gdb stopped typing cd working_dir and then started it manually by typing r. This works, but Xcode will complain constantly and is not an elegant solution.
So somewhere in the build settings I have to set the working directory .. but where ?!
In Xcode, do Get Info on the executable and look at the first tab - there is an option for the working directory.
Just update this solution to XCode 4.x
You go on Product -> Scheme -> Change Schema
On the Options tab, you select the working directory.
In Xcode 4, the working directory settings are located under Schema Settings.
The default debug working directory is somewhere in ~ / Library / Developer / Xcode / DerivedData / project- / Build / Products / Debug. You are better off using the full path.