Is it possible to apply "Update to recommended settings" from CLI command?

Viewed 494

After pod install command Xcode suggests Update to recommended settings.
I have a case when CI fails when the project doesn't update to the recommended settings.
I'd like to know does command that could do this from the terminal exists?
Environment:
CocoaPods : 1.10.1
Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20]
RubyGems : 3.0.3
Host : macOS 11.2.1 (20D74)
Xcode : 12.4 (12D4e)

enter image description here

1 Answers

There is no dedicated command, but you can mute them with a script. Xcode shows these warnings if one of the LastSwiftMigration, LastSwiftUpdateCheck, LastUpgradeCheck or LastTestingUpgradeCheck is lower than the current Xcode version. Check the example we use for our projects below. xcodeproj uses versions in the format like "1240" for Xcode 12.4. I use "1240" in the example; change it to the value you need.

find . \
    -type f \
    -name "\project.pbxproj" \
    -exec sed -i.orig \
    -E "s/(LastSwiftMigration|LastSwiftUpdateCheck|LastUpgradeCheck|LastTestingUpgradeCheck){1} = (.){4}/\1 = '1240'/" {} +
Related