Docs
From: Docs:
Overview
Debugging your SwiftGodot-based extensions using Xcode can either be done with a binary Godot executable that you got directly from the Godot project, or using your own build of Godot.
Make an Official Godot Engine debuggable
These steps are only required if you are using an official Godot built. If you compiled your own Godot locally, you do not need to do folow any of these steps.
-
Download Godot Engine without .Net support version in the official website.
-
Add
com.apple.security.get-task-allow
entitlement and resign it.
Warning
Alternatively you can also disable macOS’s SIP to allow debugging anything. Use at your risk.
Debug Swift code
- Launch the re-signed Godot app, choose our target project and open it in Godot.
- Open our Swift Package via Xcode and add breakpoints.
- Choose Debug → Attach to Process in the menu bar of Xcode and locate the existing Godot process here (Remember the pids of the existing Godot process).
- Go to Godot Editor and launch the game.
- Choose Debug → Attach to Process in the menu bar of Xcode again and choose the new Godot process whose pid is not in the pids list we get in Step 3.
- Trigger some event if needed and we’ll hit the breakpoints we have added in Step 2.