Problems migrating to mojave and xcode 10 (the journey to two xcodes)
I had the following problem i had high sierra with xcode 4.9 with cocoapods that are compatible with swifth 4. everything was ok. But i didn’t have the patience, so i installed mojave. “Because why not”. It has a dark mode!!!. And it is so pretty. So as a good programmer that don’t want to remember the past because everything it is ok installing the new update of everything i installed it and for 1 week everything was perfect.
But eventually i need to work in the last project to make some changes for my client. And everything sees fine because if you select to compile to the emulator everything work as it should be.

The problem is when you want to deliver to the qa team for testing in physics devices. For that you need to “archive” the app, but for doing the archiving you need to build in “generic device mode” In this mode it tries to compile to the specific architecture of the device in this case armv7 but it fails.
The first error i encountered is a syntax error, that swift 3 to swift 4 has some issues with the protocols without some code inside, know that some expert in swift is going to say , no that is no the problem, is why you need to do that, please fix your code, but you need to know that this code is not my at all i just heredity a problem, that i need to fix.

So i spent a lot of hours trying to make this work. (if you wan’t the answer you need to wait because it was hard and i want you to know how hard it was. Naa just joking the final solution was to install xcode 4.9.1 again, and for my surprise there is a compatible version for mojave, but there some things that you need to know for using two xcodes in the same computer).
So i went to https://swift.org/download/#releases and download the file for swift 4.1.2 that was the most close to the original code version.

It is important to notice that i downloaded the two files, the toolchain and the debugging symbols.

After i installed it and re-try to compile, for my surprise it works it compiles in “generic mode”, Hurray!!!!. So i created the file “.ipa” and distributed with daiwi.com. So i started downloading and it got stuck. Horror again. The ipa file got corrupted. So i was a little disapointed.
After that i tried my last resource. Download again the xcode 9.4.1 (very specific). (You can download inside the developer.apple.com web page in downloads. https://developer.apple.com/download/more/

Next, I installed it, a it compiles, Hurray, it creates IPA, Hurray, and when i try to installed it works. AWESOME!!!!.
But not everything it is so easy for this workaround to work you need the two xcodes. One for developing the code and testing in the emulator withthe appropriate toolchain (Swifth 4.1.3 xxx.xxx.xxx)(Xcode 10) and the other just for compiling the code, because for some reason the emulation doesn’t work so you test the app in xcode 10. (For the two xcode to work properly you need to erase the temp files that the xcode creates every time you use it) So if you change from Xcode 10 to Xcode 9 first you need to remove (https://stackoverflow.com/questions/18933321/can-i-safely-delete-contents-of-xcode-derived-data-folder)
If you don’t do this the xcode could be behave extrange. And you can loose a lot of time trying to understand why is not working.
Lastly, First sorry for my mistakes writing this article, i just want to get out of my system this frustration, because i know someone has a similar problem. Im going to fix the redaction later.