# Compile error with XCode exit code 6

**URL:** <https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962>\
**Category:** Platform & Builds\
**Tags:** MAC, unreal-engine, UE4\
**Created:** [July 22, 2022, 6:13pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962 "2022-07-22T18:13:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mpjyky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mpjyky](https://forums.unrealengine.com/u/mpjyky)\
**Post date:** [July 22, 2022, 6:13pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962/1 "2022-07-22T18:13:53Z")

</div>

Hello,  
When I try and build my AirSim project with XCode I get the Shell Script Invocation Error XCodeBuild.sh failed with exit code 6.

I am running:  
Xcode 13.4.1  
Mac OS 12.4  
Unreal Engine 4.27.2

I need to use Unreal 4 because AirSim is only compatible with this version of Unreal.  
I have tried verifying using the dropdown on the Unreal launch button but still no luck with building the project.

---

<div class="post-metadata">

**Author:** ![HollowWorldGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HollowWorldGames](https://forums.unrealengine.com/u/HollowWorldGames)\
**Post date:** [July 24, 2022, 6:22pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962/2 "2022-07-24T18:22:31Z")

</div>

Make sure you are not using the legacy build system in the xcode project settings. I had a similar issue and that fixed it.

---

<div class="post-metadata">

**Author:** ![mpjyky](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mpjyky](https://forums.unrealengine.com/u/mpjyky)\
**Post date:** [July 24, 2022, 10:56pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962/3 "2022-07-24T22:56:31Z")

</div>

That got me past this error. Unfortunately for me there are more errors to debug 😢

---

<div class="post-metadata">

**Author:** ![HollowWorldGames](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@HollowWorldGames](https://forums.unrealengine.com/u/HollowWorldGames)\
**Post date:** [July 25, 2022, 1:47pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962/4 "2022-07-25T13:47:14Z")

</div>

Glad I could help hopefully you don’t have the utf-16 character issues I had moving code from windows to mac. Good luck with the remainder of your errors, hopefully they won’t be too hard to fix.

---

<div class="post-metadata">

**Author:** ![CodeCalibre](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/codecalibre/32/908537_2.png) [@CodeCalibre](https://forums.unrealengine.com/u/CodeCalibre)\
**Post date:** [August 14, 2022, 3:53pm UTC](https://forums.unrealengine.com/t/compile-error-with-xcode-exit-code-6/611962/5 "2022-08-14T15:53:39Z")

</div>

One possibility is just to regenerate your project files via `GenerateProjectFiles.sh`. This worked for me several times. However, I do find the re-occurrence of the error mysterious.
