Xcode
Xcode 是一个免费的macOS专用IDE, 你可以从Mac App Store下载它.
导入项目
From Xcode's main screen create a new project using the Other > External Build System template.

Now choose a name for your project and set the path to scons executable in build tool (to find the path you can type
where scons
in a terminal).

Open the main target from the Targets section and select the Info tab.

按以下设置填写表格:
参数
参见 构建系统介绍, 获取完整的参数列表.
目录
到Godot根文件夹的完整路径
Add a Command Line Tool target which will be used for indexing the project by choosing File > New > Target....

Select macOS > Application > Command Line Tool.

备注
为它命名, 以使你知道不使用该目标进行编译(例如 GodotXcodeIndex
).
For this target open the Build Settings tab and look for Header Search Paths.
将 Header Search Paths 设置为 Godot 根文件夹的绝对路径。子目录也需要包含进来,为此,请在路径末尾添加两个星号(
**
),例如/Users/me/repos/godot-source/**
。将Godot源码拖放到项目文件浏览器中, 将其添加到项目中.
Select Create groups for the Added folders option and check only your command line indexing target in the Add to targets section.

Xcode现在将索引这些文件. 这可能需要几分钟的时间.
一旦Xcode完成了索引, 你应该有跳转定义, 自动完成和完整的语法突出显示.
调试项目
要启用调试支持, 需要编辑外部构建目标的构建和运行方案.
打开外部构建目标的方案编辑器.
定位到 Build > Post Actions 区.
增加一个新的脚本运行操作
Under Provide build settings from select your project. This allows to reference the project directory within the script.
创建一个脚本, 给二进制文件起一个Xcode可以识别的名字, 例如:
ln -f ${PROJECT_DIR}/godot/bin/godot.macos.tools.64 ${PROJECT_DIR}/godot/bin/godot

构建外部构建目标.
再次打开方案编辑器, 然后选择 运行 .

Set the Executable to the file you linked in your post-build action script.
Check Debug executable.
You can add two arguments on the Arguments tab: the
-e
flag opens the editor instead of the Project Manager, and the--path
argument tells the executable to open the specified project (must be provided as an absolute path to the project root, not theproject.godot
file).
To check that everything is working, put a breakpoint in platform/macos/godot_main_macos.mm
and
run the project.
如果遇到问题, 也可在 Godot 社区论坛 中寻求帮助.