compiling_for_ios.rst 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 with the iOS 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 target=debug
  25. for a Simulator executable.
  26. Additionally since some time Apple requires 64 bit version of application binary when you are uploading to iStore.
  27. The best way to provide these is to create a bundle in which there are both 32bit and 64 binaries, so every device will be able to run the game.
  28. It can be done in three steps, first compile 32 bit version, then compile 64 bit version and then use ``lipo`` to bundle them into one fat binary, all those steps can be performed with following commands:
  29. ::
  30. $ scons p=iphone tools=no bits=32 target=release arch=arm
  31. $ scons p=iphone tools=no bits=64 target=release arch=arm64
  32. $ lipo -create bin/godot.iphone.opt.32 bin/godot.iphone.opt.64 -output bin/godot.iphone.opt.universal
  33. Run
  34. ---
  35. To run on a device or simulator, follow these instructions:
  36. :ref:`doc_exporting_for_ios`.
  37. Replace or add your executable to the Xcode project, and change the
  38. "executable name" property on Info.plist accordingly if you use an
  39. alternative build.