For what it's worth, this is a problem they (said) they addressed in latest Xcode. We'll see how that turns out in practice I guess.
It looks simple but it's actually about 6 different programs all stuck together.
Codesigning breaks on it periodically, and it takes days to fix.
XCode 8 has just broken this worse than any other XCode version in history. It seems to have done so by trying to automate all its requirements. So now it outputs broken bundles when I compile it. This has taken me all of today, and I'll be surprised if I have it working within the next 6 hours of work.
This is a fairly typical experience of using XCode for me. Many times getting codesigning working correctly and getting it working within the mac app store parameters takes more time than writing the code.
In short: Using XCode is harder than programming.