Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

在 macOS 上執行

使用 gdb 為編輯器進行除錯

將除錯器附加到具有簽章的 macOS 程序上需要“com.apple.security.get-task-allow”授權,預設未啟用,因為啟用時 App 無法進行公證。如果你想要除錯官方建構的編輯器,就需要使用正確的授權重新進行簽章。

建立包含如下內容的 editor.entitlements 文字檔:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>com.apple.security.cs.allow-dyld-environment-variables</key>
        <true/>
        <key>com.apple.security.cs.allow-jit</key>
        <true/>
        <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
        <true/>
        <key>com.apple.security.cs.disable-executable-page-protection</key>
        <true/>
        <key>com.apple.security.cs.disable-library-validation</key>
        <true/>
        <key>com.apple.security.device.audio-input</key>
        <true/>
        <key>com.apple.security.device.camera</key>
        <true/>
        <key>com.apple.security.get-task-allow</key>
        <true/>
    </dict>
</plist>

可以使用下列指令來移除產生的匯出樣板:

codesign -s - --deep --force --options=runtime --entitlements ./editor.entitlements ./path/to/Godot.app

對專案進行除錯

要允許除錯,請在匯出時選擇 ''codesigndebugging''(''com.apple.security.get-task-allow'')授權。選中後不支持公證,所以應該將其停用。