How can I use the legacy build system with Xcode 1

2019-02-02 23:36发布

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?

3条回答
该账号已被封号
2楼-- · 2019-02-02 23:53

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

查看更多
Viruses.
3楼-- · 2019-02-03 00:01

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.

查看更多
Root(大扎)
4楼-- · 2019-02-03 00:06

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"
)
查看更多
登录 后发表回答