This page documents Godot's export system: the EditorExportPlatform base class, the intermediate PC platform class, platform-specific export plugins, and the common pipeline shared across all targets. This page does not cover the resource importer pipeline (see Resource Import System) or the resource loader/saver (see ResourceLoader and ResourceSaver).
The export system converts a Godot project into a self-contained deliverable for a target platform. This involves:
.pck (pack) file or embedding them into a platform binary.EditorExportPlugin instances to inject files, modify resources, or alter manifests.All export platforms are registered with EditorExport::get_singleton(), which also maintains the list of presets and plugins.
Class hierarchy of export platform types
Sources: editor/export/editor_export_platform.h49-50 editor/export/editor_export_platform_pc.h platform/android/export/export_plugin.h65-66 platform/macos/export/export_plugin.h platform/ios/export/export_plugin.h35-36 platform/windows/export/export_plugin.h platform/linuxbsd/export/export_plugin.h platform/web/export/export_plugin.h
EditorExportPlatform is defined in editor/export/editor_export_platform.h49-50 and implemented in editor/export/editor_export_platform.cpp It extends RefCounted.
| Type | Location | Purpose |
|---|---|---|
EditorExportSaveFunction | editor/export/editor_export_platform.h56 | Callback signature for saving one file during export |
EditorExportRemoveFunction | editor/export/editor_export_platform.h57 | Callback for removing a file in patch mode |
EditorExportSaveSharedObject | editor/export/editor_export_platform.h58 | Callback for saving shared libraries |
DebugFlags enum | editor/export/editor_export_platform.h60-66 | Bitfield: DEBUG_FLAG_DUMB_CLIENT, DEBUG_FLAG_REMOTE_DEBUG, etc. |
ExportMessageType enum | editor/export/editor_export_platform.h68-73 | EXPORT_MESSAGE_NONE, INFO, WARNING, ERROR |
SavedData struct | editor/export/editor_export_platform.h81-93 | Per-file metadata written into the PCK directory |
PackData struct | editor/export/editor_export_platform.h95-103 | State for a PCK write operation |
SavedData fields| Field | Type | Description |
|---|---|---|
ofs | uint64_t | Byte offset of file content in PCK |
size | uint64_t | Original (pre-encryption) size |
encrypted | bool | Whether AES-256 encryption was applied |
removal | bool | Patch removal marker |
delta | bool | Content is a delta-encoded patch |
md5 | Vector<uint8_t> | MD5 of original data |
path_utf8 | CharString | File path relative to res:// |
PackData fields| Field | Description |
|---|---|
path | Output .pck file path |
salt | 32-character random string for path obfuscation (empty = no obfuscation) |
f | FileAccess handle to PCK file |
file_ofs | Accumulated SavedData entries forming the PCK directory |
use_sparse_pck | When true, each file is written to a separate path rather than contiguously |
Sources: editor/export/editor_export_platform.h56-103
Export pipeline: from export_project to final output
Sources: editor/export/editor_export_platform.cpp427-570 editor/export/editor_export_platform.cpp635-752 editor/export/editor_export_platform.cpp794-822
Three collection strategies exist, selected based on preset configuration:
_export_find_resources() at editor/export/editor_export_platform.cpp635-645 recursively walks the EditorFileSystemDirectory tree and includes all non-TextFile resources._export_find_customized_resources() at editor/export/editor_export_platform.cpp648-664 respects per-directory FileExportMode settings (export, strip, remove)._export_find_dependencies() at editor/export/editor_export_platform.cpp666-685 recursively follows resource dependencies from a set of seed files.After collection, _edit_filter_list() at editor/export/editor_export_platform.cpp735-752 applies comma-separated glob patterns from the preset's include/exclude strings, operating recursively over the res:// directory tree.
The PCK format is defined by constants PACK_HEADER_MAGIC and PACK_FORMAT_VERSION from core/io/file_access_pack.h. Files are written contiguously with 16-byte alignment (PCK_PADDING = 16 at editor/export/editor_export_platform.cpp93):
(path, offset, size, md5, flags) entries.MD5 of the original (pre-encryption) data is stored for integrity verification, computed with CryptoCore::md5() at editor/export/editor_export_platform.cpp463-469
When path obfuscation is active (PackData::salt is 32 chars), the stored filename is sha256(path + salt) instead of the plain path.
_encrypt_and_store_data() at editor/export/editor_export_platform.cpp373-425 applies AES-256 encryption via FileAccessEncrypted. The encryption key comes from _get_script_encryption_key(), which reads the GODOT_SCRIPT_ENCRYPTION_KEY environment variable. Per-file encryption is gated by include/exclude filter lists from the preset.
When a non-zero seed is provided, a deterministic IV is derived from the file content and seed using a PCG hash editor/export/editor_export_platform.cpp393-406
_save_pack_patch_file() at editor/export/editor_export_platform.cpp481-539 implements patch generation:
PackedData (baseline packs).DeltaEncoding::encode_delta() to produce a binary diff.get_patch_delta_min_reduction().Android .apk and .aab files are supported as baseline packs via _extract_android_assets() at editor/export/editor_export_platform.cpp223-328 which unpacks the embedded assets.sparsepck.
ExportNotifier is a RAII wrapper at editor/export/editor_export_platform.cpp794-822 that ensures plugin lifecycle callbacks fire around the export:
_export_begin(features, debug, path, flags) on all registered EditorExportPlugin instances._export_end() on all plugins and clears their state.Feature tags are assembled by get_features() at editor/export/editor_export_platform.cpp754-791 from:
get_platform_features()).get_preset_features())."template", "debug"/"release", "template_debug"/"template_release", "double"/"single".create_preset() at editor/export/editor_export_platform.cpp612-633 instantiates an EditorExportPreset, calls get_export_options() on the platform and all export plugins, and populates the preset's properties, values, and update_visibility maps.
EditorExportPlatformPC at editor/export/editor_export_platform_pc.h is an intermediate class shared by Windows and Linux/BSD. It provides:
get_preset_features() — emits texture format tags (s3tc, bptc, etc2, astc), shader baker tag, and the selected architecture editor/export/editor_export_platform_pc.cpp38-53get_export_options() — adds common options: custom_template/debug, custom_template/release, debug/export_console_wrapper, binary_format/embed_pck, texture format toggles, shader baker editor/export/editor_export_platform_pc.cpp56-69export_project() — copies the export template, optionally embeds the PCK by appending it to the executable, and generates a console wrapper editor/export/editor_export_platform_pc.cppMapping of platform class names to source files
Sources: platform/android/export/export_plugin.cpp platform/macos/export/export_plugin.cpp platform/ios/export/export_plugin.cpp platform/windows/export/export_plugin.cpp platform/linuxbsd/export/export_plugin.cpp platform/web/export/export_plugin.cpp
EditorExportPlatformAndroid)Source: platform/android/export/export_plugin.h65 platform/android/export/export_plugin.cpp
Two export modes exist:
| Mode | Description |
|---|---|
| APK (template) | Uses a pre-built APK template. Files written via save_apk_file → store_in_apk using minizip. |
| Gradle build | Copies files into a Gradle project structure via rename_and_store_file_in_gradle_project. Invokes Gradle to compile. |
APK export formats:
| Constant | Value | Output |
|---|---|---|
EXPORT_FORMAT_APK | 0 | .apk file |
EXPORT_FORMAT_AAB | 1 | .aab (Android App Bundle) |
Supported ABIs (from get_abis() at platform/android/export/export_plugin.cpp686-694):
| ABI | Architecture |
|---|---|
armeabi-v7a | arm32 |
arm64-v8a | arm64 |
x86 | x86_32 |
x86_64 | x86_64 |
Manifest handling:
_fix_manifest() patches the binary AndroidManifest inside the APK._write_tmp_manifest() at platform/android/export/export_plugin.cpp1026 generates a temporary XML manifest that Gradle merges into the final manifest._get_manifest_info() at platform/android/export/export_plugin.cpp973 collects permissions (from ANDROID_PERMS[]), hardware features (e.g., Vulkan level/version), and metadata entries.get_android_manifest_element_contents().Icons: Launcher icons are exported at six density levels (xxxhdpi → mdpi) as .webp files. Adaptive icons support foreground, background, and monochrome layers platform/android/export/export_plugin.cpp248-282
One-click deploy: A background thread (_check_for_changes_poll_thread at platform/android/export/export_plugin.cpp294) polls adb devices every 3 seconds when a runnable preset exists, maintaining the device list for remote deployment.
Keystore: Debug keystores are auto-generated via keytool if absent (_create_editor_debug_keystore_if_needed() at platform/android/export/export_plugin.cpp913), using settings from EditorSettings under export/android/debug_keystore*.
Gradle utilities are in platform/android/export/gradle_export_util.cpp including _create_project_name_strings_files() for locale-specific string resources and _get_activity_tag() / _get_application_tag() for manifest XML generation.
EditorExportPlatformMacOS)Source: platform/macos/export/export_plugin.cpp platform/macos/export/export_plugin.h
Distribution types:
| Type | Outputs | Notes |
|---|---|---|
| Testing | .app, .zip, .dmg (macOS only) | Ad-hoc or no signing |
| Distribution | .app, .zip, .dmg (macOS only) | Full signing |
| App Store | .pkg (macOS only) | Requires provisioning profile, sandbox |
Code signing tools (selected by codesign/codesign preset option):
| Value | Tool | Notes |
|---|---|---|
| 0 | Disabled | No signing |
| 1 | Built-in (ad-hoc) | Self-signed, no certificate |
| 2 | rcodesign | Cross-platform; no dynamic library support |
| 3 | codesign | macOS host only |
Notarization tools: rcodesign (value 1) or notarytool (value 2/3), configured via notarization/ preset keys.
Architectures: universal (fat binary via lipo), x86_64, arm64. Universal builds include both s3tc/bptc (x86_64) and etc2/astc (arm64) texture features.
get_binary_extensions() at platform/macos/export/export_plugin.cpp386-411 returns the list based on selected distribution type.
Privacy manifest entries are defined in data_collect_type_info[] and data_collect_purpose_info[] at platform/macos/export/export_plugin.cpp418-463
EditorExportPlatformIOS)Source: platform/ios/export/export_plugin.cpp platform/ios/export/export_plugin.h35
EditorExportPlatformIOS extends EditorExportPlatformAppleEmbedded (defined in editor/export/editor_export_platform_apple_embedded.h).
Output: Xcode project directory, optionally built into an .ipa via xcodebuild.
Icon generation (_export_icons() at platform/ios/export/export_plugin.cpp233):
get_icon_infos() returns a list of IconInfo structs covering Settings, Notifications, Spotlight, and Home Screen sizes.Contents.json for Xcode asset catalog.Launch screen: _export_loading_screen_file() at platform/ios/export/export_plugin.cpp136 generates [email protected] and [email protected] from the project's boot splash or custom storyboard images.
Targeted device family: iPhone only (1), iPad only (2), or both (1,2) — configured via application/targeted_device_family.
EditorExportPlatformWindows)Source: platform/windows/export/export_plugin.cpp platform/windows/export/export_plugin.h
Extends EditorExportPlatformPC.
Icon processing: _process_icon() at platform/windows/export/export_plugin.cpp72 reads .ico or image files and produces a multi-resolution .ico (16, 32, 48, 64, 128, 256 px).
Template modification: modify_template() at platform/windows/export/export_plugin.cpp192 calls _add_data() to embed version info and icon into the PE executable via Windows resource editing.
Export flow in export_project() at platform/windows/export/export_plugin.cpp203:
find_export_template()).libEGL, libGLESv2) and D3D12 Agility SDK DLLs.EditorExportPlatformPC::export_project() to embed/write PCK._code_sign() if enabled..zip if requested.Optional companion DLLs:
| DLL | Condition |
|---|---|
libEGL.dll, libGLESv2.dll | ANGLE enabled (export_angle option or rendering driver is opengl3_angle) |
D3D12Core.dll, d3d12SDKLayers.dll | D3D12 Agility SDK enabled |
accesskit.dll | Always copied if present alongside template |
EditorExportPlatformLinuxBSD)Source: platform/linuxbsd/export/export_plugin.cpp
Extends EditorExportPlatformPC.
export_project() at platform/linuxbsd/export/export_plugin.cpp61:
EditorExportPlatformPC::export_project() for PCK handling._export_debug_script() at platform/linuxbsd/export/export_plugin.cpp46The debug script sets the terminal title and launches the game binary with forwarded arguments. Output can be a bare binary or a .zip.
Supported architectures: x86_32, x86_64, arm64, arm32, rv64, ppc64, loong64.
EditorExportPlatformWeb)Source: platform/web/export/export_plugin.cpp platform/web/export/export_plugin.h
Exports to HTML5/WebAssembly. The export template is a .zip file containing the compiled Emscripten artifacts.
Template extraction: _extract_template() at platform/web/export/export_plugin.cpp48 unpacks the template ZIP, renaming godot.* files to <project_name>.*.
HTML patching: _fix_html() at platform/web/export/export_plugin.cpp132 replaces placeholder tokens in the HTML template:
| Placeholder | Replacement |
|---|---|
$GODOT_URL | <name>.js |
$GODOT_PROJECT_NAME | Project name from settings |
$GODOT_CONFIG | JSON engine configuration object |
$GODOT_SPLASH | <name>.png (boot splash) |
$GODOT_THREADS_ENABLED | "true" or "false" |
Engine config keys injected into the JSON config object:
| Key | Source |
|---|---|
canvasResizePolicy | html/canvas_resize_policy |
experimentalVK | html/experimental_virtual_keyboard |
focusCanvas | html/focus_canvas_on_start |
gdextensionLibs | Shared object paths |
fileSizes | Map of filename to byte size |
godotPoolSize | threads/godot_pool_size |
PWA support: _build_pwa() at platform/web/export/export_plugin.cpp226 generates:
<name>.manifest.json — Web App Manifest with icons at 144×144 and 512×512.<name>.service.worker.js — Offline caching service worker.<name>.offline.html — Offline fallback page.Each platform is registered via a register_<platform>_exporter() function called during editor startup. These functions:
EDITOR_DEF_BASIC) for SDK paths, signing tools, etc.EditorExport::get_singleton()->add_export_platform(exporter).| Function | File |
|---|---|
register_android_exporter() | platform/android/export/export.cpp46 |
register_windows_exporter() | platform/windows/export/export.cpp41 |
register_macos_exporter() | platform/macos/export/export.cpp |
register_linuxbsd_exporter() | platform/linuxbsd/export/export.cpp |
register_web_exporter() | platform/web/export/export.cpp |
Type registration (for ClassDB) uses the companion register_<platform>_exporter_types() function, e.g. GDREGISTER_VIRTUAL_CLASS(EditorExportPlatformAndroid) at platform/android/export/export.cpp43
Sources: platform/android/export/export.cpp platform/windows/export/export.cpp platform/macos/export/export.cpp platform/linuxbsd/export/export.cpp platform/web/export/export.cpp
add_message(type, category, text) accumulates ExportMessage entries during export. fill_log_messages() at editor/export/editor_export_platform.cpp117-221 renders these into a RichTextLabel with color-coded icons for info, warning, and error severity. The worst message type is tracked via get_worst_message_type() and determines the overall export status indicator.
Refresh this wiki
This wiki was recently refreshed. Please wait 2 days to refresh again.