iOS builds working on latest Xcode?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By moojo
:warning: Old Version Published before Godot 3 was released.

Following the instructions on this page : Compiling for iOS — Godot Engine (stable) documentation in English
Compiling
Open a Terminal, go to the root dir of the engine source code and type:

$ scons p=iphone bin/godot.iphone.debug

Question 1: For Mac, the root dir of the engine source code is the directory with the file Godot.app?

I’m getting this message from the terminal:
scons: *** No SConstruct file found.
File “/usr/local/Cellar/scons/2.4.1/libexec/scons-local/SCons/Script/Main.py”, line 923, in _main

Question 2:
Is there a more elaborate tutorial that shows how to make iOS builds to run on a device? I’ve worked on this for a couple of days but its not working.

:bust_in_silhouette: Reply From: Freeman

Your question is a little misleading. You also ask about two different things here. Try to avoid it in the future and reflect the question with problem you have.
I don’t know about latest Xcode, I am on OSX 10.10.5 and Xcode 7.2 right now, so I will try to answer your questions from my that “version” perspective.

Ad 1.
After downloading and unpacking the source (or pulling it with git command) from Github (not an official download from official Godot website - hey are already compiled Godot binaries), you will end up with the folder named probably “godot” or “godot-2.1-stable” or “godot-2.1.1-stable”. This is the root of your Godot dir. In this root folder you should find all other folders, like:
/bin
/core
/doc
/drivers
/modules
/main
/platform

etc. so if you don’t see such folders, it’s not a root folder. And afaik there should not be Godot.app in it.

Ad 2.
Docs are unfortunately outdated and actually misleading for new versions of Godot. I did not find any recent description of compilation nor publishing process. For the last 2-3 weeks in my spare time I was trying to compile for iOS myself for the first time and I know the pain. I finally did that last night, I hope, but I am not sure, because I am not able to test binaries yet.
To predict trables you will encounter, for now I can tell you, that the option ‘bits=32’ or ‘bit=64’ are not used anymore and arch=arm or arch=arm64 should be used accordingly. Otherwise lipo command for creating fat binary will not work for you and end up with the error I described on github iOS fat binary creation does not work. · Issue #7329 · godotengine/godot · GitHub
Also, option ‘p=isim’ for creating iOS simulator binary is deprecated in new version of Godot and p=iphone ios_sim=yes options should be used instead. That’s all the changes I found during my 2 week investigation :slight_smile:
You should be able to compile templates now.

Compilation itself is simple, but it’s not even close to actually testing nor publishing for iOS which has to be done outside Godot, in the Xcode IDE.

I plan, that when (I hope it’s not the question of “if” but “when”) I manage to publish my app, I will create Q&A entry and show step by step terrible experience of compilation and publishing for iOS, but I hope my above explanation helps for now.

And of course if you find a way to conquer Xcode and publish the app before I do, please take the time and share the findings here as well. :slight_smile: