Building game binaries for IOS

Hi,

I’m building an IOS/Android mobile game and it’s mostly a content only project but with a small amount of native code (so we’ve had to build our own binaries).

I’m aware that you can’t build IOS binaries on windows though, so purchased a Mac mini to generate the IOS binaries on (the idea is not to work on the Mac, just to generate the binaries once and return to deploying on PC; we almost never change the code). The Mac is running OS X Yosemite (10.10.4) and is a 2.4GHz Intel core 2 Duo, 4GB of ram and an Nvidia GeForce 320M (256MB). I also installed Xcode on it.

I managed to generate the certificate, mobile provision and key outside of Xcode and that all works fine (plugging them into the IOS project settings on PC). But I have NO idea how to go about generating an IOS binary. I’ve been doing some reading and there’s a lot of material out there about downloading the engine source and doing a remote build of the whole thing on the Mac (which is overkill here), but I can’t find a straight forward solution for just building the game code specifically.

I installed Unreal 4.8.3 on the Mac and ran the editor (which worked fine and I could create a new project). I also managed to connect to our SVN server in Xcode and download our project onto the Mac. When I open up the .uproject though, it immediately says that “UE4Editor-Game.dylib does not exist”, I allow it to compile it (it opens up a console and I can see it building our game module), but then the editor immediately crashes:

MachineId:9B49FA777C473D610F584EA537A82146
EpicAccountId:f8e99177c497485e9a95ff9299be87c5

Generating report for minidump

Application version 4.8.3-0
 ... built from changelist 2634408

OS version 10.10.4.20038
Running 1 x64 processors
Exception was " BUS_ADRERR at 0x1236b38bc"

Source context from ""

<SOURCE START>
<SOURCE END>

<CALLSTACK START>
FTextFormatHelper::Format(FText const&, int, TBaseDelegate<FFormatArgumentValue const*, FString const&, int>, TSharedPtr<FTextHistory, (ESPMode)1> const&, bool, bool) Address = 0x10598de54 (filename not found) [in UE4Editor-Core.dylib]
FText::FormatInternal(FText const&, TArray<FFormatArgumentValue, FDefaultAllocator> const&, bool, bool) Address = 0x10593f96f (filename not found) [in UE4Editor-Core.dylib]
FText::Format(FText const&, FText const&) Address = 0x10593df3c (filename not found) [in UE4Editor-Core.dylib]
LoadPackageInternal(UPackage*, wchar_t const*, unsigned int, FLinkerLoad*) Address = 0x1063b291d (filename not found) [in UE4Editor-CoreUObject.dylib]
FLinkerLoad::VerifyImportInner(int, FString&) Address = 0x10622d3a1 (filename not found) [in UE4Editor-CoreUObject.dylib]
FLinkerLoad::VerifyImport(int) Address = 0x10622782f (filename not found) [in UE4Editor-CoreUObject.dylib]
FLinkerLoad::VerifyImportInner(int, FString&) Address = 0x10622b529 (filename not found) [in UE4Editor-CoreUObject.dylib]
...

I’ve also tried moving this compiled .dylib to the PC to see if I can use it to run the game on IOS, but it just crashes the IOS run tool too.

I’m presuming if it didn’t crash on the Mac, I could run the game on IOS there and then check in the resulting binaries? If so, I need to work out why the Mac is crashing and I’ll hopefully have a working solution.

If not, is there a way to simply compile the project on the Mac, check some files in and be done with it? Or do I HAVE to get the entire engine first and build it remotely on the Mac?

Cheers,

  • Phil

Update: I suddenly realised that I could generate an Xcode project from the uproject. That seems to be taking me in the correct direction. Except now I’m suffering from a build error:

Setting up Mono

Building DefendyRocket...

Directories : System.String[] /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk

Compiling with IOS SDK 8.4

Compiling with these architectures: armv7

Unzipping: /Users/Shared/UnrealEngine/4.8/Engine/Plugins/Runtime/Advertising/IOSTapJoy/ThirdPartyFrameworks/Tapjoy.embeddedframework.zip -> /Users/macuser/Desktop/XCode Projects/Defendy Rocket/Intermediate/UnzippedFrameworks/ThirdPartyFrameworks/Tapjoy.embeddedframework

unzip:  cannot find or open /Users/Shared/UnrealEngine/4.8/Engine/Plugins/Runtime/Advertising/IOSTapJoy/ThirdPartyFrameworks/Tapjoy.embeddedframework.zip, /Users/Shared/UnrealEngine/4.8/Engine/Plugins/Runtime/Advertising/IOSTapJoy/ThirdPartyFrameworks/Tapjoy.embeddedframework.zip.zip or /Users/Shared/UnrealEngine/4.8/Engine/Plugins/Runtime/Advertising/IOSTapJoy/ThirdPartyFrameworks/Tapjoy.embeddedframework.zip.ZIP.

Performing 5 actions (2 in parallel)

[1/5] clang++ DefendyRocket.generated.cpp

[2/5] clang++ DR_GameMode.cpp

[3/5] clang++ DefendyRocket.cpp

[4/5] clang++ UELinkerFixups.cpp

[5/5] clang++ /Users/macuser/Desktop/XCode Projects/Defendy Rocket/Binaries/IOS/DefendyRocket

ld: framework not found TapJoy

clang: error: linker command failed with exit code 1 (use -v to see invocation)

-------- End Detailed Actions Stats -----------------------------------------------------------

ERROR: UBT ERROR: Failed to produce item: /Users/macuser/Desktop/XCode Projects/Defendy Rocket/Binaries/IOS/DefendyRocket

Total build time: 58.40 seconds

Command /Users/Shared/UnrealEngine/4.8/Engine/Build/BatchFiles/Mac/RocketBuild.sh failed with exit code 5

Looking into this at the moment. Will report back if I make any more progress.

Update #2: Fixed the TapJoy issue by booting the project up on PC and disabling the TapJoy plugin in the plugin manager. Actually managed to build various builds now on the Mac, although building (what I think is) a mac editor build doesn’t solve the crash on when running the game’s editor project on the Mac, and I seemed to be able to make an IOS build (tried various ones) but the game crashes on iPhone at startup (not sure why). Been playing around with the Xcode configurations trying to see if there’s anything obviously wrong, but can’t find anything at this point. Will continue looking/trying.

If you have launched from the editor on the iPhone you can subsequently launch directly from XCode - and debug :slight_smile: It will run your new executable against the already deployed assets.

At least that’s been my experience.

On the Mac, I’ve still not managed to get the editor to run our own project (I can open the editor from the launcher and make a new project, just not open our own project without a crash). I can build and run the game on iPhone, but it’ll crash on startup (probably doesn’t have any cooked content, I’m guessing).

If I copy the files generated to PC, I still can’t run IOS either. I get all of the way through the deploy process and the game fails to launch.

That’s as far as I got today before I gave up.

I decided to see if I could get some more information about what’s causing the game to crash when starting up the editor. So I’ve chosen the MyGameEditor-Mac option in Xcode, made sure the scheme was set to ‘Debug’ (And that ‘Debug executable’ was checked and ‘-debug’ was checked in the arguments tab), and pointed the executable to the ‘UE4Editor.app’ in the UE4 install directory (in binaries/mac).

Run the project from Xcode, let it build and it booted up the editor as normal. As always it gets to around 80-100% then crashes. Xcode caught the crash and I’ve put a screenshot of what it displayed, but not being a professional programmer, there’s not really anything useful for me to take away from it. Maybe this will shed some light on why the Mac editor crashed originally in my first post, though.

Also - if you are stuck - any reason not to try 4.9 preview? I haven’t tried version 4 yet but version 3 has been proving pretty stable and the jump from 4.8 for me was pretty seamless.

Funnily enough (and I need to come back and update this thread shortly), but I ran out of things to try on the 4.8 front so decided to give 4.9 P4 a shot. And yes, that solved the issue of not being able to load the project on the Mac. I’ve even managed to run the game on iPhone via the editor at this point, but I haven’t been able to run the game on PC with those same executables (I’ve just tried building development/shipping binaries in Xcode and checking them in, but I’m still seeing a deployment fail on PC). Hopefully will have a solution (or at least some more information) shortly.

Just a quick end-of-day update on this. Still no luck getting iOS to deploy on PC. Everything seems to work fine on the Mac though. Figured I could just produce shipping builds on the Mac when the time came, but the build process just gets stuck when trying to produce a shipping build (no errors in the output window, it just stops progressing with ‘deploying to iOS’ prompt animating in the corner of the screen).

Will need to return to this tomorrow and try some more stuff.