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

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.)


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


To extend DarkDust's answer, in case you're using fastlane for automated builds, additional parameters such as UseModernBuildSystem can be passed through xcargs:

build_app(
   // ... other necessary parameters,
   xcargs: "-UseModernBuildSystem=NO"
)

To select Xcode 10's build system:

In Xcode, go to: File -> Project Settings (or Workspace Settings)-> Build System

From there you can select New Build System (Default) or Legacy Build System

Hope this help makes this easier.


Currently, I'm using Xcode version 12.0 (12A7209) and follow the below steps and then you can use legacy build mode:

  1. Workspace Setting:

    enter image description here

  2. Set the legacy build mode:

    enter image description here