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.
Checking the stable version of the documentation...
为 iOS 平台编译¶
参见
这个页面描述的是如何从源码编译 iOS 导出模板二进制。如果你想要找的是导出项目到 iOS,请阅读 为 iOS 导出。
需求¶
SCons 3.0+ 构建系统.
Xcode(或更轻量的 Xcode 命令行工具)。
If you are building the master
branch:
Download and follow README instructions to build a static
.xcframework
from the MoltenVK SDK.
编译¶
打开终端, 转到引擎源代码的根目录并键入:
$ scons p=ios target=template_debug
针对调试版本, 或:
$ scons p=ios target=template_release
for a release build (check platform/ios/detect.py
for the compiler
flags used for each configuration).
或者, 你可以运行
$ scons p=ios target=template_debug ios_simulator=yes arch=x86_64
$ scons p=ios target=template_debug ios_simulator=yes arch=arm64
for a Simulator libraries.
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.
$ cp -r misc/dist/ios_xcode .
$ cp libgodot.ios.debug.arm64.a ios_xcode/libgodot.ios.debug.xcframework/ios-arm64/libgodot.a
$ lipo -create libgodot.ios.debug.arm64.simulator.a libgodot.ios.debug.x86_64.simulator.a -output ios_xcode/libgodot.ios.debug.xcframework/ios-arm64_x86_64-simulator/libgodot.a
$ cp libgodot.ios.opt.arm64.a ios_xcode/libgodot.ios.release.xcframework/ios-arm64/libgodot.a
$ lipo -create libgodot.ios.opt.arm64.simulator.a libgodot.ios.opt.x86_64.simulator.a -output ios_xcode/libgodot.ios.release.xcframework/ios-arm64_x86_64-simulator/libgodot.a
The MoltenVK static .xcframework
folder must also be placed in the ios_xcode
folder once it has been created.
运行¶
要在设备或模拟器上运行, 请按照以下说明操作: 为 iOS 导出.