Search code examples
xcodeconfigurationcompilationxcodebuild

xcodebuild cause fatal error but in Xcode, compilation is OK


I have a weird thing when I try to compile with xcodebuild. If I open the project on the mac with XCode, the code compile without any warning.

If I use the following command line : xcodebuild -configuration Debug -target myApp PROVISIONING_PROFILE=B5AD0E27-B224-4962-B0DC-XXXXXXXX

I have some compilation error : /Users/myUser/.jenkins/jobs/myApp/workspace/prj/Controllers/DeclarerEtape1Adresse.m:75:6: error: receiver type 'DeclarerEtape1Adresse' for instance message does not declare a method with selector 'rechercheAdresse' [4] [self rechercheAdresse]; ^ 1 error generated.

This errors can appear in external code (taken from github). It seems that the compilator is much strict in command line mode than with Xcode.

Is there any specific configuration in command line ?

Thank you for your feedback.


Solution

  • James, you're the boss :p I tried xcodebuild -version on both environment and the ci server used an old SDK 4.2.X. So I used the sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer and it fixes the issue