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.

Compiling for iOS

더 보기

이 페이지는 소스로부터 iOS 내보내기 템플릿 바이너리를 컴파일하는 방법을 설명합니다. 프로젝트를 iOS로 내보내는 방법을 찾는다면 :ref:`doc_exporting_for_ios`을 읽으시기 바랍니다.

요구사항

  • Python 3.8+.

  • SCons 4.0+ build system.

  • Xcode.
    • Launch Xcode once and install iOS support. If you have already launched Xcode and need to install iOS support, go to Xcode -> Settings... -> Platforms.

    • Go to Xcode -> Settings... -> Locations -> Command Line Tools and select an installed version. Even if one is already selected, re-select it.

  • Download and follow README instructions to build a static .xcframework from the MoltenVK SDK.

참고

If you have Homebrew installed, you can easily install SCons using the following command:

brew install scons

Installing Homebrew will also fetch the Command Line Tools for Xcode automatically if you don't have them already.

Similarly, if you have MacPorts installed, you can easily install SCons using the following command:

sudo port install scons

더 보기

To get the Godot source code for compiling, see Getting the source.

For a general overview of SCons usage for Godot, see Introduction to the buildsystem.

컴파일링(Compiling)

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.

실행

To run on a device or simulator, follow these instructions: iOS로 내보내기.