ios - xcode command line build failed with



XCode Version: Version 7.2 (7C68)
Building for PhoneGAP IOS
Commands used:

xcodebuild -project HelloCordova.xcodeproj -scheme HelloCordova -configuration Release -sdk iphonesimulator IDENTIFIER=com.kony.SyncApp build 

It used to work well before upgrading Xcode after upgrading to 7.2 , i am facing this issue. And same wokring form XCODE UI Problem with command line build

Error Info:

fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated.


The following build commands failed:
    ProcessPCH /Users/konysync/Library/Developer/Xcode/DerivedData/HelloCordova-gyroiomjvclmgtfewwtckeoypgfd/Build/Intermediates/PrecompiledHeaders/CordovaLib_Prefix-almeazhzuslzcvewimbluxlrnwby/CordovaLib_Prefix.pch.pch CordovaLib_Prefix.pch normal armv7 objective-c
    ProcessPCH /Users/konysync/Library/Developer/Xcode/DerivedData/HelloCordova-gyroiomjvclmgtfewwtckeoypgfd/Build/Intermediates/PrecompiledHeaders/CordovaLib_Prefix-bvlrmrstkahcccfcihrhcdumeenk/CordovaLib_Prefix.pch.pch CordovaLib_Prefix.pch normal arm64 objective-c

(2 failures)

found some links , but those links did not help.
Apple LLVM Compiler 3.1 error clang
Unsupported compiler '' selected for architecture 'x86_64' on Xcode 7 Beta 2

1 Answer: 

This is a bug introduced in Xcode 7.2 (and still not fixed as of 7.2.1), see It seems that xcodebuild is not setting correctly the ARCH and PLATFORM_NAME variables when invoked with -sdk iphonesimulator.

There are two known workarounds at the moment, both involve passing extra flags to xcodebuild:

1) Pass the -destination flag, eg:

xcodebuild [...] -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6'

2) Override the PLATFORM variable, eg:

xcodebuild [...] -sdk iphonesimulator PLATFORM_NAME=iphonesimulator