Xcode Installation Issues

I know this exists in parts all over the Epic forums and the official documentation has some cryptic procedures but is there a definitive and clear path to success to make UE work with Xcode?

I was doing the awesome Twin Stick tutorial by Zak Parrish and episode 5 requires an Integrated Development Environment (IDE)
but there’s no instruction on how to get that up and running.

After doing all of the following steps, repeating some steps and perhaps doing even more, I finally got it to work and completed the project. It’s a great tutorial and I highly recommend it, but you’ll need to get your IDE running first.
(Note: As of July 23rd 2018, Visual Studio for the Mac doesn’t support C++, so we must use Xcode as our free IDE)

Here’s an external source for getting Xcode to work with iOS from Nacelle Games.

Somewhat Complete Installation Steps to Install Xcode with UE4
Step 1: Create an account with Epic Games and install the Unreal Engine Editor

Step 2: Download and install Xcode from the App Store

Step 3: Create a new C++ project in Unreal Engine and then create a new C++ asset

If everything is set correctly, Xcode will launch automatically.

Step 4: Switch over to Xcode and make your code changes.

Note: You may need to turn “Show C++ Classes” on in your Content Browser’s View Options dropdown menu.

Whether or not you’re supposed to build there with the Unreal Editor open is unknown to me.

There are many settings in Xcode, none of which are intuitive. Which settings are the specific ones that UE4 cares about?

Is there a configuration that will work with all other projects? After finding success with Twin Stick Shooter I boldly tried to create a new C++ project and it didn’t work. Is it possible that the space in my Folder name to create the file is causing grief for UE4 and the IDE?

What’s the difference between the “Compile” button on the UE editor menu and “Build” in the IDE? Does one affect the other?

There are some unclear settings for Compiling in Xcode that says to create a file in the “Home” folder which is not defined, with an extension but no known name.

Sometimes when I build I get this error message:
ERROR: UBT ERROR: Failed to produce item: /Users/jMac/Documents/Unreal Projects/TwinStickShooter/Binaries/Mac/UE4Editor-TwinStickShooter.dylib
Total build time: 57.66 seconds (Local executor: 0.00 seconds)
Command /Users/Shared/Epic Games/UE_4.19/Engine/Build/BatchFiles/Mac/Build.sh failed with exit code 5

Which led me to this link but I still don’t know how to fix it.

Troubleshooting
Make sure your Xcode file is where Unreal Engine expects it.

Verify your Unreal Engine version by clicking the dropdown menu in the Unreal Launcher. It rebuilds connections to the software which might mysteriously make it work.

Ensure that the active scheme in Xcode is the “Editor”
(? In Xcode’s dropdown for Schemes there’s “Debug Editor” and “Development Editor”)

You may try Deleting Intermediate folder and other temp folders

If your “Clean Project” causes Shared UE4Editor.app to lose it’s binary

If you want iOS breakpoints and you installed a helper software like Homebrew you may need to run Terminal with this line of code:
echo “settings set target.inline-breakpoint-strategy always” >> ~/.lldbinit

If you’re missing the .dylib file you may need to move files around

If you’re switching between your IDE and Unreal Engine you may have to mess with your anti-virus software

Generate Xcode Project by right clicking on your project’s .uproject icon in the finder and then select “Generate Xcode Project”. If you run into trouble you may need to create a C++ folder.

Can someone from Epic (or anyone who’s epic!) please rewrite what I have here? I still don’t know what settings Xcode should have or how to create breaklines, how to make it so that I don’t have to quit Xcode in order to run UE4 (?) and vice versa, what a Hot Reload is and how to make it work. It’s all voodoo right now and the online documentation doesn’t list the procedures step by step. While writing this I revisited every one of these links and rebuilt, regenerated, deleted and recreated the project and eventually it was able to be opened again.

I was ultimately able to get the Twin Stick project to open again by deleting those folders and then verifying my UE4.19.2 and then launching the TwinStickShooter and rebuilding the Modules:
“The Following modules are missing or built with a different engine version:
UE3Editor-TwinStickShooter.dylib
Would you like to rebuild them now?”
When I click yes it takes a moment to run a “Mono” script and then the project can be opened again.
If I quit and reopen it, sometimes the Modules have to be rebuilt, sometimes they don’t. I don’t know what the pattern is, but if I had clear step-by-step instructions it may mitigate those problems.

I tried finding the link:procedures to get Xcode up and running on Reddit but the conversation turned to other IDEs.

Update
After writing this and starting a new TwinStickShooter C++ project, I see that Xcode has automatically opened the project and while I had the UE4 editor open in the background I went to Xcode and clicked Build (without changing any code) and it worked with two warnings: Update to recommended settings to adopt “Product Bundle Identifier” build settings for a series of files. There’s a button to “Perform Changes” which re-built the project with no warnings. So it appears to be working? It would still be great if someone who knows what they’re doing for Xcode and UE4 to rewrite this.

btw: Xcode 8.0-compatible is automatically selected in the Project Format in Xcode. Would 9.3 be better?

Even though I can successfully Build in one project, Xcode doesn’t appear to work with the next C++ tutorial:

Performing 12 actions (8 in parallel)

[1/12] Compile SharedPCH.Engine.h

[2/12] Compile UdemyCTestProjectile.gen.cpp

[3/12] Compile UdemyCTestHUD.gen.cpp

[4/12] Compile UdemyCTestGameMode.gen.cpp

[5/12] Compile UdemyCTestCharacter.gen.cpp

[6/12] Compile UdemyCTest.init.gen.cpp

[7/12] Compile UdemyCTestProjectile.cpp

[8/12] Compile UdemyCTestHUD.cpp

[9/12] Compile UdemyCTestGameMode.cpp

[10/12] Compile UdemyCTestCharacter.cpp

[11/12] Compile UdemyCTest.cpp

[12/12] Link UE4Editor-UdemyCTest.dylib

clang: error: no such file or directory: '/Users/Shared/Epic Games/UE_4.19/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Core.dylib'

clang: error: no such file or directory: '/Users/Shared/Epic Games/UE_4.19/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-CoreUObject.dylib'

clang: error: no such file or directory: '/Users/Shared/Epic Games/UE_4.19/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Engine.dylib'

clang: error: no such file or directory: '/Users/Shared/Epic Games/UE_4.19/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-InputCore.dylib'

clang: error: no such file or directory: '/Users/Shared/Epic Games/UE_4.19/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-HeadMountedDisplay.dylib'

ERROR: UBT ERROR: Failed to produce item: /Users/jMac/Documents/Unreal Projects/UdemyCTest/Binaries/Mac/UE4Editor-UdemyCTest.dylib

Total build time: 46.32 seconds (Local executor: 0.00 seconds)

Command /Users/Shared/Epic Games/UE_4.19/Engine/Build/BatchFiles/Mac/Build.sh failed with exit code 5