Kompilieren für iOS

Siehe auch

This page describes how to compile iOS export template binaries from source. If you're looking to export your project to iOS instead, read Exportieren für iOS.

Voraussetzungen

  • SCons 3.0+ (you can install it via Homebrew or MacPorts, you should be able to run scons in a terminal when installed).

  • Xcode 10.0 (oder höher) mit dem iOS (10.0) SDK und den Befehlszeilentools.

Siehe auch

To get the Godot source code for compiling, see Die Quelldatei erhalten.

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

Kompilieren

Öffnen Sie ein Terminal, wechseln in das Stammverzeichnis des Engine-Quellcodes und geben Folgendes ein:

$ scons p=iphone target=debug

für einen Debug-Build, oder:

$ scons p=iphone target=release

für einen Release-Build (überprüfen Sie platform/iphone/detect.py auf die Compiler-Flags, die für jede Konfiguration verwendet werden).

Alternativ können Sie ausführen

$ scons p=iphone arch=x86_64 target=debug

für eine ausführbare Simulator-Datei.

For recent devices, Apple requires 64-bit versions of application binaries when you are uploading to the Apple Store. The best way to provide these is to create a bundle in which there are both 32-bit and 64-bit binaries, so every device will be able to run the game.

It can be done in three steps: first compile the 32-bit version, then compile the 64-bit version and then use lipo to bundle them into one "universal" binary. All those steps can be performed with following commands:

$ scons p=iphone tools=no target=release arch=arm
$ scons p=iphone tools=no target=release arch=arm64
$ lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a -output bin/libgodot.iphone.release.fat.a
$ lipo -create bin/libgodot_camera_module.iphone.opt.arm.a bin/libgodot_camera_module.iphone.opt.arm64.a -output bin/libgodot_camera_module.iphone.release.fat.a
$ lipo -create bin/libgodot_arkit_module.iphone.opt.arm.a bin/libgodot_arkit_module.iphone.opt.arm64.a -output bin/libgodot_arkit_module.iphone.release.fat.a

If you also want to provide a simulator build (reduces the chance of any linker errors with dependencies), you'll need to build and lipo the x86_64 architecture as well.

$ scons p=iphone tools=no target=release arch=arm
$ scons p=iphone tools=no target=release arch=arm64
$ scons p=iphone tools=no target=release arch=x86_64
$ lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a bin/libgodot.iphone.opt.x86_64.a -output bin/libgodot.iphone.release.fat.a
$ lipo -create bin/libgodot_camera_module.iphone.opt.arm.a bin/libgodot_camera_module.iphone.opt.arm64.a bin/libgodot_camera_module.iphone.opt.x86_64.a -output bin/libgodot_camera_module.iphone.release.fat.a
$ lipo -create bin/libgodot_arkit_module.iphone.opt.arm.a bin/libgodot_arkit_module.iphone.opt.arm64.a bin/libgodot_arkit_module.iphone.opt.x86_64.a -output bin/libgodot_arkit_module.iphone.release.fat.a

Ausführen

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

Replace or add your executable to the Xcode project, and change the "executable name" property on Info.plist accordingly if you use an alternative build.