+9 votes

In the documentation I found this article: http://docs.godotengine.org/en/latest/reference/cross-compiling_for_ios_on_linux.html

In the end it says: "Then you will have an iOS fat binary."

Does this mean we can now export to iOS on Linux? I mean will we get the .ipa file without having a Macbook, iMac etc.?

in Engine by (103 points)

2 Answers

+3 votes
Best answer

As far as I can remember from the devs talks on irc, yes, it is possible, but not easy. I takes some steps and system preparation and the link describes exactly that.

by (710 points)
selected by
The result of the steps is a iOS fat binary. And whats the next step? How do I now export my project to an .ipa, which I can put on my iOS device?
It is a fat binary because it probably supports both armv6 armv7 architecture.
The proper way to install things on ios is through itunes of course.
I am not sure how to install things on mac, without itunes account, as I have never done that, but I imagine jailbreak and using software like CopyTrans Apps  should be the answer you are looking for.

As of how to put binary fat into ipa, like I said I have never done that, but maybe just renaming it, the extension will be enough?
I will try it when I finally made the fat. I have some problems, I will make a new question. Thank you Freeman! :))

You can't generate an ipa without having a Mac. Problem is, that ipa files are bound to one or more devices, specified by their device id. So you can't just share an ipa to someone and it will run on his/her iDevice.

+1 vote

I think yes, I am currently able to compile the latest godot eninge for MacOS on linux. and also able to for iphone on linux as well. but there some extra effort we need to prepare, to compile mac build toolchain, iphone build toolchain for linux. I could share with you, if you would like to.

by (65 points)

Any information you can share would be greatly appreciated!

MacOS Toolchain on Linux

export GIT_REPO=~/Documents/git
export TOOL_HOME=/opt/tool
cd $GIT_REPO
mkdir -p tpoechtrager
cd $GIT_REPO/tpoechtrager
git clone https://github.com/tpoechtrager/osxcross.git
cd $GIT_REPO/tpoechtrager/osxcross
export XCODEDIR=$TOOL_HOME/xcode/Xcode.app
./tools/gen_sdk_package.sh
mv MacOSX10.11.sdk.tar.xz tarballs/
./build.sh
mkdir -p $TOOL_HOME/osxcross
cp -r $GIT_REPO/tpoechtrager/osxcross/target $TOOL_HOME/osxcross
export OSXCROSS_ROOT=$TOOL_HOME/osxcross

iPhoneOS Toolchain on Linux

export GIT_REPO=~/Documents/git
export TOOL_HOME=/opt/tool
cd $GIT_REPO
mkdir daeken
cd $GIT_REPO/daeken
git clone https://github.com/daeken/ldid.git
cd $GIT_REPO/daeken/ldid
./make.sh
sudo cp ./ldid /usr/bin/
mkdir -p $TOOL_HOME/xcode/iPhoneSDK/iPhoneOS9.3.sdk
cp -r $TOOL_HOME/xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/* $TOOL_HOME/xcode/iPhoneSDK/iPhoneOS9.3.sdk
cp -r $TOOL_HOME/xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/* $TOOL_HOME/xcode/iPhoneSDK/iPhoneOS9.3.sdk/usr/include/c++
cd $TOOL_HOME/xcode/iPhoneSDK
tar -cf - * | xz -9 -c - > iPhoneOS9.3.sdk.tar.xz
cd $GIT_REPO
mkdir -p tpoechtrager
cd $GIT_REPO/tpoechtrager
git clone https://github.com/tpoechtrager/cctools-port.git
cd $GIT_REPO/tpoechtrager/cctools-port/usage_examples/ios_toolchain
./build.sh $TOOL_HOME/xcode/iPhoneSDK/iPhoneOS9.3.sdk.tar.xz arm64
mkdir -p $TOOL_HOME/iostoolchain/usr
cp -r target/bin $TOOL_HOME/iostoolchain/usr/
export OSXCROSS_IOS=$TOOL_HOME/iostoolchain

build.sh

#!/bin/sh
export ANDROID_HOME=/opt/tool/android-sdk-linux
export ANDROID_NDK_ROOT=/opt/tool/android-sdk-linux/ndk-bundle
export OSXCROSS_IOS=/opt/tool/iostoolchain/usr/bin
export OSXCROSS_ROOT=/opt/tool/osxcross
export GIT_REPO=$HOME/Documents/git
# Update from the latest commit
cd $GIT_REPO/godotengine/godot && git pull
# Build Server for Linux
cd $GIT_REPO/godotengine/godot
scons platform=server target=release_debug tools=yes bits=64 -j 8
scons platform=server target=release_debug tools=yes bits=32 -j 8
echo 'Build Server for Linux'
# Build Editor for Linux
cd $GIT_REPO/godotengine/godot
scons platform=x11 target=release_debug tools=yes bits=64 -j 8
scons platform=x11 target=release_debug tools=yes bits=32 -j 8
echo 'Build Tool for Linux'
# Build Editor for Window
cd $GIT_REPO/godotengine/godot
scons platform=windows target=release_debug tools=yes bits=64 -j 8
scons platform=windows target=release_debug tools=yes bits=32 -j 8
echo 'Build Tool for Window'
# Build Editor for  MacOS
cd $GIT_REPO/godotengine/godot
scons platform=osx target=release_debug bits=64 tools=yes osxcross_sdk=darwin15 -j 8
cp -r $GIT_REPO/godotengine/godot/tools/Godot.app $GIT_REPO/godotengine/godot/bin
mkdir -p $GIT_REPO/godotengine/godot/bin/Godot.app/Contents/MacOS
cp $GIT_REPO/godotengine/godot/bin/godot.osx.opt.tools.64 bin/Godot.app/Contents/MacOS/Godot
chmod +x $GIT_REPO/godotengine/godot/bin/Godot.app/Contents/MacOS/Godot
cd $GIT_REPO/godotengine/godot/bin
zip -r Godot.app.zip Godot.app
echo 'Build Tool for MacOS'
############
# Template #
############
# Build Export Template for Window
cd $GIT_REPO/godotengine/godot
scons platform=windows tools=no target=release bits=32
scons platform=windows tools=no target=release_debug bits=32
scons platform=windows tools=no target=release bits=64
scons platform=windows tools=no target=release_debug bits=64
echo 'Build Export Template for Window'
# Build Export Template for Linux
scons platform=x11 tools=no target=release bits=32
scons platform=x11 tools=no target=release_debug bits=32
scons platform=x11 tools=no target=release bits=64
scons platform=x11 tools=no target=release_debug bits=64
echo 'Build Export Template for Linux'
# Building Export Template for Android
cd $GIT_REPO/godotengine/godot
scons platform=android target=release tools=no -j 8
scons platform=android target=release_debug tools=no -j 8
cd $GIT_REPO/godotengine/godot/platform/android/java
gradle clean assembleDebug assembleRelease
echo 'Build Export Template for Android'
# Build Binary for iOS
cd $GIT_REPO/godotengine/godot
scons platform=iphone tools=no arch=arm target=release IPHONESDK="/opt/tool/xcode/iPhoneSDK/iPhoneOS9.3.sdk" IPHONEPATH="/opt/tool/iostoolchain" ios_triple="arm-apple-darwin11-" -j 8
scons platform=iphone tools=no arch=arm target=release_debug IPHONESDK="/opt/tool/xcode/iPhoneSDK/iPhoneOS9.3.sdk" IPHONEPATH="/opt/tool/iostoolchain" ios_triple="arm-apple-darwin11-" -j 8
scons platform=iphone tools=no arch=arm64 target=release IPHONESDK="/opt/tool/xcode/iPhoneSDK/iPhoneOS9.3.sdk" IPHONEPATH="/opt/tool/iostoolchain" ios_triple="arm-apple-darwin11-" -j 8
scons platform=iphone tools=no arch=arm64 target=release_debug IPHONESDK="/opt/tool/xcode/iPhoneSDK/iPhoneOS9.3.sdk" IPHONEPATH="/opt/tool/iostoolchain" ios_triple="arm-apple-darwin11-" -j 8
$OSXCROSS_IOS/arm-apple-darwin11-lipo -create $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.arm $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.arm64 -output $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.fat
$OSXCROSS_IOS/arm-apple-darwin11-lipo -create $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.debug.arm $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.debug.arm64 -output $GIT_REPO/godotengine/godot/bin/godot.iphone.opt.debug.fat
echo 'Build Binary for iOS'
# Build Godot Document for HTML
cd $GIT_REPO/godotengine/godot-docs && git pull
make html
echo 'Build Godot Document for HTML'
cd $GIT_REPO/godotengine

I have an error with Templates of iOS :

/opt/tool/iostoolchain/usr/bin/arm-apple-darwin11-ld: error while loading shared libraries: libtapi.so: cannot open shared object file: No such file or directory
clang-4.0: error: unable to execute command: No such file or directory
clang-4.0: error: linker command failed due to signal (use -v to see invocation)
scons: *** [bin/godot.iphone.opt.debug.arm64] Error 255
scons: building terminated because of errors.

Do you know to resolve it ?

Thanks for sharing. I'm getting this error:

/home/travis/osxcross/target/bin/i386-apple-darwin14-c++ -o platform/osx/sem_osx.osx.tools.32.o -c -g3 -DDEBUG_ENABLED -DDEBUG_MEMORY_ENABLED -w -DFT2_BUILD_LIBRARY -DZLIB_DEBUG -DFREETYPE_ENABLED -DDEBUG_MEMORY_ALLOC -DSCI_NAMESPACE -DENABLE_DEPRECATED -DAPPLE_STYLE_KEYS -DUNIX_ENABLED -DGLES2_ENABLED -DOSX_ENABLED -mmacosx-version-min=10.9 -DTOOLS_ENABLED -DGDSCRIPT_ENABLED -DMINIZIP_ENABLED -DXML_ENABLED -DGLEW_STATIC -DGLEW_ENABLED -Icore -Icore/math -Ieditor -Idrivers -I. -Iplatform/osx -Ithirdparty/zlib -Ithirdparty/glew -Ithirdparty/freetype -Ithirdparty/freetype/include -Ithirdparty/libpng platform/osx/sem_osx.cpp
osxcross: error: cannot find libc++ headers
osxcross: error: while detecting target
scons: *** [platform/osx/sem_osx.osx.tools.32.o] Error 1

Any idea what could be the problem?

Same error here!

error while loading shared libraries: libtapi.so
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories