macOS用にエクスポート

参考

This page describes how to export a Godot project to macOS. If you're looking to compile editor or export template binaries from source instead, read macOS へのコンパイル.

macOS apps exported with the official export templates are exported as a single "Universal 2" binary .app bundle, a folder with a specific structure which stores the executable, libraries and all the project files. This bundle can be exported as is, packed in a ZIP archive, or packed in a DMG disk image (only supported when exporting from macOS). Universal binaries for macOS support both Intel x86_64 and ARM64 (Apple Silicon) architectures.

警告

Due to file system limitations, .app bundles exported from Windows lack the executable flag and won't run on macOS. Projects exported as .zip are not affected by this issue. To run .app bundles exported from Windows on macOS, transfer the .app to a device running macOS or Linux and use the chmod +x {executable_name} terminal command to add the executable permission. The main executable located in the Contents/MacOS/ subfolder, as well as optional helper executables in the Contents/Helpers/ subfolder, should have the executable permission for the .app bundle to be valid.

必要条件

  • Download the Godot export templates. Use the Godot menu: Editor > Manage Export Templates.

  • A valid and unique Bundle identifier should be set in the Application section of the export options.

警告

Projects exported without code signing and notarization will be blocked by Gatekeeper if they are downloaded from unknown sources, see the Running Godot apps on macOS page for more information.

Code signing and notarization

By default, macOS will run only applications that are signed and notarized. If you use any other signing configuration, see Running Godot apps on macOS for workarounds.

To notarize an app, you must have a valid Apple Developer ID Certificate.

If you have an Apple Developer ID Certificate and exporting from macOS

Install Xcode command line tools and open Xcode at least once or run the sudo xcodebuild -license accept command to accept license agreement.

To sign exported app

  • Select Xcode codesign in the Code Signing > Codesign option.

  • Set valid Apple ID certificate identity (certificate "Common Name") in the Code Signing > Identity section.

To notarize exported app

  • Select Xcode altool in the Notarization > Notarization option.

  • Disable the Debugging entitlement.

  • Set valid Apple ID login / app. specific password or App Store Connect API UUID / Key in the Notarization section.

You can use the xcrun notarytool history command to check notarization status and use the xcrun notarytool log {ID} command to download the notarization log.

If you encounter notarization issues, see Resolving common notarization issues for more info.

After notarization is completed, staple the ticket to the exported project.

If you have an Apple Developer ID Certificate and exporting from Linux or Windows

Install PyOxidizer rcodesign, and configure the path to rcodesign in the Editor Settings > Export > macOS > rcodesign.

To sign exported app

  • Select PyOxidizer rcodesign in the Code Signing > Codesign option.

  • Set valid Apple ID PKCS #12 certificate file and password in the Code Signing section.

To notarize exported app

  • Select PyOxidizer rcodesign in the Notarization > Notarization option.

  • Disable the Debugging entitlement.

  • Set valid App Store Connect API UUID / Key in the Notarization section.

You can use the rcodesign notary-log command to check notarization status.

After notarization is completed, use the rcodesign staple command to staple the ticket to the exported project.

If you do not have an Apple Developer ID Certificate

  • Select Built-in (ad-hoc only) in the Code Signing > Codesign option.

  • Select Disabled in the Notarization > Notarization option.

In this case Godot will use an ad-hoc signature, which will make running an exported app easier for the end users, see the Running Godot apps on macOS page for more information.

Signing Options

Option

説明

Codesign

Tool to use for code signing.

識別子

The "Full Name" or "Common Name" of the signing identity, store in the macOS keychain. [1]

Certificate File

The PKCS #12 certificate file. [2]

Certificate Password

Password for the certificate file. [2]

Custom Options

Array of command line arguments passed to the code signing tool.

Notarization Options

Option

説明

Notarization

Tool to use for notarization.

Apple Account名

Apple ID account name (email address). [3]

Apple Accountパスワード

Apple ID app-specific password. See Using app-specific passwords to enable two-factor authentication and create app password. [3]

Apple Team ID

Team ID ("Organization Unit"), if your Apple ID belongs to multiple teams (optional). [3]

API UUID

Apple App Store Connect API issuer UUID.

API Key

Apple App Store Connect API key.

注釈

You should set either Apple ID Name/Password or App Store Connect API UUID/Key.

詳しくは`Notarizing macOS Software Before Distribution <https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution?language=objc>`__を参照してください。

Entitlements

Hardened Runtimeエンタイトルメント

Hardened Runtimeエンタイトルメントはセキュリティオプションとリソースアクセスポリシーを管理します。詳細は Hardened Runtime を参照してください。

Entitlement

説明

Allow JIT Code Execution [4]

Allows creating writable and executable memory for JIT code. If you are using add-ons with dynamic or self-modifying native code, enable them according to the add-on documentation.

Allow Unsigned Executable Memory [4]

Allows creating writable and executable memory without JIT restrictions. If you are using add-ons with dynamic or self-modifying native code, enable them according to the add-on documentation.

Allow DYLD Environment Variables [4]

Allows app to uss dynamic linker environment variables to inject code. If you are using add-ons with dynamic or self-modifying native code, enable them according to the add-on documentation.

Disable Library Validation

Allows app to load arbitrary libraries and frameworks. Enable it if you are using GDExtension add-ons or ad-hoc signing, or want to support user-provided external add-ons.

Audio Input

マイクやその他の音声入力ソースを使用する場合は有効にしてください。この項目を有効にしている場合は、privacy/microphone_usage_description オプションに利用に関するメッセージを入力してください。

カメラ

カメラを使用する場合は有効にしてください。この項目を有効にしている場合は、privacy/camera_usage_description オプションに利用に関するメッセージを入力してください。

位置

位置情報サービスからの位置情報を使用する場合は有効にしてください。この項目を有効にしている場合は、privacy/location_usage_description オプションに利用に関するメッセージを入力してください。

連絡先

[5] Enable to allow access contacts in the user's address book, if it's enabled you should also provide usage message in the privacy/address_book_usage_description option.

カレンダー

[5] Enable to allow access to the user's calendar, if it's enabled you should also provide usage message in the privacy/calendar_usage_description option.

Photo Library

[5] Enable to allow access to the user's Photos library, if it's enabled you should also provide usage message in the privacy/photos_library_usage_description option.

Appleイベント

[5] Enable to allow app to send Apple events to other apps.

デバッグ

[6] You can temporarily enable this entitlement to use native debugger (GDB, LLDB) with the exported app. This entitlement should be disabled for production export.

App Sandboxエンタイトルメント

The App Sandbox restricts access to user data, networking and devices. Sandboxed apps can't access most of the file system, can't use custom file dialogs and execute binaries (using OS.execute and OS.create_process) outside the .app bundle. See App Sandbox for more info.

注釈

App Storeでアプリを配布するには、App Sandboxを有効にする必要があります。

Entitlement

説明

有効

App Sandboxを有効にする。

Network Server

Enable to allow app to listen for incoming network connections.

Network Client

Enable to allow app to establish outgoing network connections.

Device USB

アプリがUSBデバイスとやりとりできます。このエンタイトルメントは、有線コントローラを使用するのに必要です。

Device Bluetooth

アプリがBluetoothデバイスとやりとりできます。このエンタイトルメントはワイヤレスコントローラを使用するのに必要です。

Files Downloads [7]

ユーザーの「ダウンロード」フォルダへの読み取りまたは書き込みを許可します。

Files Pictures [7]

ユーザーの「ピクチャ」フォルダへの読み取りまたは書き込みを許可します。

Files Music [7]

ユーザーの「ミュージック」フォルダへの読み取りまたは書き込みを許可します。

Files Movies [7]

ユーザーの「ムービー」フォルダへの読み取りまたは書き込みを許可します。

Files User Selected [7]

ユーザーが選択した任意のフォルダへの読み取りまたは書き込みを許可します。読み書きするには、ユーザーがネイティブファイルダイアログからフォルダを選択する必要があります。

Helper Executable

List of helper executables to embedded to the app bundle. Sandboxed app are limited to execute only these executable.

注釈

You can override default entitlements by selecting custom entitlements file, in this case all other entitlement are ignored.

環境変数

You can use the following environment variables to set export options outside of the editor. During the export process, these override the values that you set in the export menu.

macOS export environment variables

Export option

Environment variable

Encryption / Encryption Key

GODOT_SCRIPT_ENCRYPTION_KEY

Options / Codesign / Certificate File

GODOT_MACOS_CODESIGN_CERTIFICATE_FILE

Options / Codesign / Certificate Password

GODOT_MACOS_CODESIGN_CERTIFICATE_PASSWORD

Options / Codesign / Provisioning Profile

GODOT_MACOS_CODESIGN_PROVISIONING_PROFILE

Options / Notarization / API UUID

GODOT_MACOS_NOTARIZATION_API_UUID

Options / Notarization / API Key

GODOT_MACOS_NOTARIZATION_API_KEY

Options / Notarization / API Key ID

GODOT_MACOS_NOTARIZATION_API_KEY_ID

Options / Notarization / Apple ID Name

GODOT_MACOS_NOTARIZATION_APPLE_ID_NAME

Options / Notarization / Apple ID Password

GODOT_MACOS_NOTARIZATION_APPLE_ID_PASSWORD

エクスポートオプション

You can find a full list of export options available in the EditorExportPlatformMacOS class reference.