Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use the legacy build system with Xcode 10's `xcodebuild`?

I'd like to use the new build system of Xcode 10 for development, but our build in our continuous integration system fails since the xcarchive produced has an issue: the Info.plist in the xcarchive is missing the ApplicationProperties key and the information therein!

It turns out switching back to the legacy build system fixes this. This can be done in the workspace settings (File > Workspace Settings… > Build System). But I would prefer to keep the new build system for development and only use the legacy build system for CI builds.

Is there a way to make xcodebuild use the legacy build system without modifying the workspace?

like image 244
DarkDust Avatar asked Jul 06 '18 07:07

DarkDust


2 Answers

There is an (as of yet undocumented) flag in xcodebuild: -UseModernBuildSystem=<value>. The value can be either 0 or NO to use the legacy ("original") build system, or 1 or YES to use the new build system.

For example:

xcodebuild -workspace Foo.xcworkspace -scheme Bar -configuration Release -archivePath /path/to/Foo.xcarchive clean archive -UseModernBuildSystem=NO

(-UseNewBuildSystem=<value> seems to work as well; this flags was introduced in Xcode 9 but I suspect UseModernBuildSystem is going to be the "official" flag for this.)

like image 151
DarkDust Avatar answered Oct 17 '22 22:10

DarkDust


Change build system to Legacy Build System from New Build System and vice versa.

Open Xcode --> Select File -->Select Workspace Settings

enter image description here

Change Build System to Legacy Build System from New Build System --> Click Done.

enter image description here

like image 51
Naresh Avatar answered Oct 17 '22 21:10

Naresh