Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Kompilieren für iOS

Siehe auch

Diese Seite beschreibt, wie man iOS-Exportvorlagen-Binärdateien aus dem Quellcode kompiliert. Wenn Sie Ihr Projekt stattdessen für iOS exportieren möchten, lesen Sie Exportieren für iOS.

Anforderungen

  • Python 3.8+.

  • SCons 4.0+ build system.

  • Xcode.
    • Starten Sie Xcode einmal und installieren Sie die iOS-Unterstützung. Wenn Sie Xcode bereits gestartet haben und die iOS-Unterstützung installieren müssen, gehen Sie zu Xcode -> Einstellungen... -> Plattformen.

    • Gehen Sie zu Xcode -> Einstellungen... -> Speicherorte -> Befehlszeilentools und wählen Sie eine installierte Version aus. Auch wenn bereits eine Version ausgewählt ist, wählen Sie sie erneut aus.

  • Laden Sie ein statisches .xcframework aus dem MoltenVK SDK herunter und folgen Sie den README-Anweisungen, um es zu bauen.

Bemerkung

Wenn Sie Homebrew installiert haben, können Sie SCons einfach mit dem folgenden Befehl installieren:

brew install scons

Bei der Installation von Homebrew werden auch automatisch die Kommandozeilen-Tools für Xcode installiert, falls Sie diese noch nicht haben.

Wenn Sie MacPorts installiert haben, können Sie SCons einfach mit dem folgenden Befehl installieren:

sudo port install scons

Siehe auch

Um den Godot-Quellcode zum Kompilieren zu erhalten, siehe Beschaffung des Quellcodes.

Eine allgemeine Übersicht über die Verwendung von SCons für Godot finden Sie unter Einführung in das Buildsystem.

Kompilieren

Open a Terminal, go to the root folder of the engine source code and type the following to compile a debug build:

scons platform=ios target=template_debug generate_bundle=yes

To compile a release build:

scons platform=ios target=template_release generate_bundle=yes

Alternatively, you can run the following command for Xcode simulator libraries (optional):

scons platform=ios target=template_debug ios_simulator=yes arch=arm64
scons platform=ios target=template_debug ios_simulator=yes arch=x86_64 generate_bundle=yes

These simulator libraries cannot be used to run the exported project on the target device. Instead, they can be used to run the exported project directly on your Mac while still testing iOS platform-specific functionality.

To create an Xcode project like in the official builds, you need to use the template located in misc/dist/ios_xcode. The release and debug libraries should be placed in libgodot.ios.debug.xcframework and libgodot.ios.release.xcframework respectively. This process can be automated by using the generate_bundle=yes option on the last SCons command used to build export templates (so that all binaries can be included).

The MoltenVK static .xcframework folder must also be placed in the ios_xcode folder once it has been created. MoltenVK is always statically linked on iOS; there is no dynamic linking option available, unlike macOS.

Ausführen

Um auf einem Gerät oder Simulator ausgeführt zu werden, befolgen Sie die folgenden Anweisungen: Exportieren für iOS.