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.

iOS용 컴파일

더 보기

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

요구 사항

  • Python 3.9+.

  • SCons 4.4+ build system.

  • Xcode.
    • Xcode를 한 번 실행하고 iOS 지원을 설치하세요. 이미 Xcode를 실행했고 iOS 지원을 설치해야 하는 경우 *Xcode -> 설정... -> 플랫폼*으로 이동하세요.

    • *Xcode -> 설정... -> 위치 -> 명령줄 도구*로 이동하여 설치된 버전을 선택하세요. 이미 선택한 경우에도 다시 선택하세요.

  • MoltenVK SDK <https://github.com/KhronosGroup/MoltenVK#fetching-moltenvk-source-code>`__에서 정적 `.xcframework``를 빌드하려면 README 지침을 다운로드하고 따르세요.

참고

`Homebrew <https://brew.sh/>`_이 설치되어 있는 경우 다음 명령을 사용하여 SCons를 쉽게 설치할 수 있습니다.

brew install scons

Homebrew를 설치하면 Xcode용 명령줄 도구가 아직 없는 경우 자동으로 가져옵니다.

마찬가지로 `MacPorts <https://www.macports.org/>`_이 설치되어 있는 경우 다음 명령을 사용하여 SCons를 쉽게 설치할 수 있습니다.

sudo port install scons

더 보기

컴파일을 위한 Godot 소스 코드를 얻으려면 소스 얻기를 참조하세요.

Godot의 SCons 사용법에 대한 일반적인 개요는 빌드 시스템 소개를 참조하세요.

컴파일링

터미널을 열고 엔진 소스 코드의 루트 폴더로 이동한 후 다음을 입력하여 디버그 빌드를 컴파일합니다.

scons platform=ios target=template_debug generate_bundle=yes

출시 빌드에서 컴파일하려면:

scons platform=ios target=template_release generate_bundle=yes

To create an Xcode project like in the official builds, you need to use the template located in misc/dist/apple_embedded_xcode. The release and debug libraries should be placed in libgodot.ios.debug.xcframework and libgodot.ios.release.xcframework respectively. Camera module libraries should be placed in libgodot_camera.ios.debug.xcframework and libgodot_camera.ios.release.xcframework. 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 apple_embedded_xcode folder once it has been created. MoltenVK is always statically linked on iOS; there is no dynamic linking option available, unlike macOS.

경고

The iOS simulator only supports the Compatibility renderer.

Apple Silicon Macs can run iOS apps natively, so you can run exported iOS projects directly on an Apple Silicon Mac without iOS simulator limitations.

실행

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

iOS 내보내기는 Apple Silicon Mac에서 직접 실행할 수 있습니다. 내보낸 iOS 프로젝트를 Mac에서 실행하려면 Xcode에서 내보낸 프로젝트를 열고 Run Destinations 드롭다운에서 ``My Mac``를 선택하세요.

문제 해결

치명적인 오류: 'cstdint' 파일을 찾을 수 없습니다.

초기에 이 양식의 컴파일 오류가 발생하는 경우 macOS 또는 Xcode 업데이트 후 Xcode 명령줄 도구 설치를 복구해야 하기 때문일 가능성이 높습니다.

./core/typedefs.h:45:10: fatal error: 'cstdint' file not found
45 | #include <cstdint>
   |          ^~~~~~~~~

Xcode 명령줄 도구를 다시 설치하려면 다음 두 명령을 실행하세요(필요에 따라 관리자 비밀번호 입력).

sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install

그래도 작동하지 않으면 Mac App Store에서 Xcode를 업데이트하고 다시 시도해 보세요.