Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild doesn't show all compile errors?

There are 2 compile errors in my project(Display in XCode).

But when I use xcodebuild to compile the project in terminal, only one compile error display

xxx$xcodebuild -sdk iphoneos -configuration Debug
....
....
[self updateAccountInfo];1
                         ^
1 warning and 1 error generated.

Is it possible to make xcodebuild display all compile errors?

In the Xcode's Preference, in the General Tab, check the "Continue building after errors" option. asked here

What I need is to use xcodebuild do the same thing.

EDIT:

After thinking and researching these days, I think xcodebuild can't do this. It's different from xcode. When we use xcode to compile iOS project, xcode compile every .m by clang. So xcode has "Continue building after errors" feature

like image 852
Wellbin Huang Avatar asked Mar 17 '23 10:03

Wellbin Huang


2 Answers

You need to set the Xcode preferences to do this (from Terminal.app):

$ defaults write com.apple.Xcode PBXBuildsContinueAfterErrors YES

for xCode 8:

$ defaults write com.apple.dt.Xcode IDEBuildingContinueBuildingAfterErrors 1
like image 190
trojanfoe Avatar answered Mar 19 '23 01:03

trojanfoe


If you want to continue building after errors using the latest version of xcodebuild/xctool you will need to run them with -IDEBuildingContinueBuildingAfterErrors=YES.

Example:

xctool -project SampleProject.xcodeproj/ -scheme SampleProject -sdk iphonesimulator build -IDEBuildingContinueBuildingAfterErrors=YES

Looks like PBXBuildsContinueAfterErrors isn't supported anymore.

Also you can use defaults write com.apple.dt.Xcode to make this setting permanent. If you want to have a look how you current version of IDE is controlling that setting you can call defaults read com.apple.dt.Xcode and search for "errors" and "continue".

like image 35
Nekto Avatar answered Mar 19 '23 02:03

Nekto