compiling_for_ios.rst 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .. _doc_compiling_for_ios:
  2. Compiling for iOS
  3. =================
  4. .. highlight:: shell
  5. Requirements
  6. ------------
  7. - SCons (you can get it from macports, you should be able to run
  8. ``scons`` in a terminal when installed)
  9. - Xcode 10.0 (or later) with the iOS (10.0) SDK and the command line tools.
  10. .. seealso:: For a general overview of SCons usage for Godot, see
  11. :ref:`doc_introduction_to_the_buildsystem`.
  12. Compiling
  13. ---------
  14. Open a Terminal, go to the root dir of the engine source code and type:
  15. ::
  16. $ scons p=iphone target=debug
  17. for a debug build, or:
  18. ::
  19. $ scons p=iphone target=release
  20. for a release build (check ``platform/iphone/detect.py`` for the compiler
  21. flags used for each configuration).
  22. Alternatively, you can run
  23. ::
  24. $ scons p=iphone arch=x86_64 target=debug
  25. for a Simulator executable.
  26. For recent devices, Apple requires 64-bit versions of application binaries when you are uploading to the Apple Store.
  27. 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.
  28. 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.
  29. All those steps can be performed with following commands:
  30. ::
  31. $ scons p=iphone tools=no target=release arch=arm
  32. $ scons p=iphone tools=no target=release arch=arm64
  33. $ lipo bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a -output bin/godot.iphone.opt.universal.a
  34. 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.
  35. ::
  36. $ scons p=iphone tools=no target=release arch=arm
  37. $ scons p=iphone tools=no target=release arch=arm64
  38. $ scons p=iphone tools=no target=release arch=x86_64
  39. $ lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a bin/libgodot.iphone.opt.x86_64.a -output bin/godot.iphone.opt.universal.simulator.a
  40. Run
  41. ---
  42. To run on a device or simulator, follow these instructions:
  43. :ref:`doc_exporting_for_ios`.
  44. Replace or add your executable to the Xcode project, and change the
  45. "executable name" property on Info.plist accordingly if you use an
  46. alternative build.